Skip to contentSkip to conversation

serial: sh: Add support R8A7790

PATCH New Nobuhiro Iwamatsu 2 participants 5 messages Sep 20, 2013 – Oct 30, 2013

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

PATCH v2 1/3 serial: sh: Add support R8A7790

This adds the preset value to register, and setup of baudrate.

---
v2: no changes

 drivers/serial/serial_sh.c |  1 +
 drivers/serial/serial_sh.h | 13 +++++++++++++
 2 files changed, 14 insertions(+)
drivers/serial/serial_sh.c +1 -0
index 67cc0dc..0826d59 100644
@@ -1,5 +1,6 @@
 /*
  * SuperH SCIF device driver.
+ * Copyright (C) 2013  Renesas Electronics Corporation
  * Copyright (C) 2007,2008,2010 Nobuhiro Iwamatsu
  * Copyright (C) 2002 - 2008  Paul Mundt
  *
drivers/serial/serial_sh.h +13 -0
index 7e38a3f..a6558af 100644
@@ -224,6 +224,9 @@ struct uart_port {
 # define SCSPTR3 0xffc60020		/* 16 bit SCIF */
 # define SCIF_ORER 0x0001		/* Overrun error bit */
 # define SCSCR_INIT(port)	0x38	/* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
+#elif defined(CONFIG_R8A7790)
+# define SCIF_ORER	0x0001
+# define SCSCR_INIT(port)	0x32	/* TIE=0,RIE=0,TE=1,RE=1,REIE=0, */
 #else
 # error CPU subtype not defined
 #endif
@@ -298,6 +301,9 @@ struct uart_port {
 /* SH7763 SCIF2 support */
 # define SCIF2_RFDC_MASK 0x001f
 # define SCIF2_TXROOM_MAX 16
+#elif defined(CONFIG_R8A7790)
+# define SCIF_ERRORS (SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK)
+# define SCIF_RFDC_MASK	0x003f
 #else
 # define SCIF_ERRORS (SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK)
 # define SCIF_RFDC_MASK 0x001f
@@ -579,6 +585,10 @@ SCIF_FNS(SCSPTR,                        0,  0, 0, 0)
 #else
 SCIF_FNS(SCSPTR,                        0,  0, 0x20, 16)
 #endif
+#if defined(CONFIG_R8A7790)
+SCIF_FNS(DL,				0,  0, 0x30, 16)
+SCIF_FNS(CKS,				0,  0, 0x34, 16)
+#endif
 SCIF_FNS(SCLSR,                         0,  0, 0x24, 16)
 #endif
 #endif
@@ -720,6 +730,9 @@ static inline int scbrr_calc(struct uart_port port, int bps, int clk)
 #define SCBRR_VALUE(bps, clk) scbrr_calc(sh_sci, bps, clk)
 #elif defined(__H8300H__) || defined(__H8300S__)
 #define SCBRR_VALUE(bps, clk) (((clk*1000/32)/bps)-1)
+#elif defined(CONFIG_R8A7790)
+#define SCBRR DL
+#define SCBRR_VALUE(bps, clk) (clk / bps / 16)
 #else /* Generic SH */
 #define SCBRR_VALUE(bps, clk) ((clk+16*bps)/(32*bps)-1)
 #endif
Signature · 1 line
1.8.4.rc3
#1 lore raw

PATCH v2 2/3 arm: rmobile: Add support r8a7790

Renesas R8A7790 is CPU with Cortex-A7 and A15. This supports the basic register definition and GPIO and framework of PFC.

---
v2: no changess.

 arch/arm/cpu/armv7/rmobile/Makefile              |    7 +-
 arch/arm/cpu/armv7/rmobile/cpu_info-r8a7790.c    |   22 +
 arch/arm/cpu/armv7/rmobile/cpu_info.c            |    5 +
 arch/arm/cpu/armv7/rmobile/lowlevel_init_ca15.S  |   60 +
 arch/arm/cpu/armv7/rmobile/pfc-r8a7790.c         | 3231 ++++++++++++++++++++++
 arch/arm/include/asm/arch-rmobile/gpio.h         |    3 +
 arch/arm/include/asm/arch-rmobile/r8a7790-gpio.h |  387 +++
 arch/arm/include/asm/arch-rmobile/r8a7790.h      |  598 ++++
 arch/arm/include/asm/arch-rmobile/rmobile.h      |    2 +
 9 files changed, 4314 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/cpu/armv7/rmobile/cpu_info-r8a7790.c
 create mode 100644 arch/arm/cpu/armv7/rmobile/lowlevel_init_ca15.S
 create mode 100644 arch/arm/cpu/armv7/rmobile/pfc-r8a7790.c
 create mode 100644 arch/arm/include/asm/arch-rmobile/r8a7790-gpio.h
 create mode 100644 arch/arm/include/asm/arch-rmobile/r8a7790.h
arch/arm/cpu/armv7/rmobile/Makefile +6 -1
index 3168e97..50bfc39 100644
@@ -9,12 +9,17 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(SOC).o
 
-SOBJS = lowlevel_init.o
 COBJS-y += cpu_info.o
 COBJS-y += emac.o
 
+SOBJS-$(CONFIG_R8A7740) += lowlevel_init.o
+SOBJS-$(CONFIG_SH73A0) += lowlevel_init.o
+SOBJS-$(CONFIG_R8A7790) += lowlevel_init_ca15.o
+SOBJS = $(SOBJS-y)
+
 COBJS-$(CONFIG_DISPLAY_BOARDINFO) += board.o
 COBJS-$(CONFIG_GLOBAL_TIMER) += timer.o
+COBJS-$(CONFIG_R8A7790) += cpu_info-r8a7790.o pfc-r8a7790.o
 COBJS-$(CONFIG_R8A7740) += cpu_info-r8a7740.o
 COBJS-$(CONFIG_R8A7740) += pfc-r8a7740.o
 COBJS-$(CONFIG_SH73A0) += cpu_info-sh73a0.o
arch/arm/cpu/armv7/rmobile/cpu_info-r8a7790.c new file +22 -0
new file mode 100644
index 0000000..7232e23
@@ -0,0 +1,22 @@
+/*
+ * arch/arm/cpu/armv7/rmobile/cpu_info-r8a7790.c
+ *     This file is r8a7790 processor support.
+ *
+ * Copyright (C) 2013 Renesas Electronics Corporation
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+#include <common.h>
+#include <asm/io.h>
+
+#define PRR 0xFF000044
+
+u32 rmobile_get_cpu_type(void)
+{
+	return (readl(PRR) & 0x00007F00) >> 8;
+}
+
+u32 rmobile_get_cpu_rev_integer(void)
+{
+	return (readl(PRR) & 0x000000F0) >> 4;
+}
arch/arm/cpu/armv7/rmobile/cpu_info.c +5 -0
index 07a33fb..6bd3c2e 100644
@@ -58,6 +58,11 @@ int print_cpuinfo(void)
 		       rmobile_get_cpu_rev_fraction());
 		break;
 
+	case 0x45:
+		printf("CPU: Renesas Electronics R8A7790 rev %d\n",
+		       rmobile_get_cpu_rev_integer());
+		break;
+
 	default:
 		printf("CPU: Renesas Electronics CPU rev %d.%d\n",
 		       rmobile_get_cpu_rev_integer(),
arch/arm/cpu/armv7/rmobile/lowlevel_init_ca15.S new file +60 -0

60 lines not on this page · raw message

arch/arm/cpu/armv7/rmobile/pfc-r8a7790.c new file +3231 -0

2,889 lines not on this page · raw message

arch/arm/include/asm/arch-rmobile/gpio.h +3 -0
index 6b5e4ed..877b394 100644

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

arch/arm/include/asm/arch-rmobile/r8a7790-gpio.h new file +387 -0

387 lines not on this page · raw message

arch/arm/include/asm/arch-rmobile/r8a7790.h new file +598 -0

598 lines not on this page · raw message

arch/arm/include/asm/arch-rmobile/rmobile.h +2 -0
index ac17561..ab39f67 100644

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

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

Signature · 1 line
1.8.4.rc3

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

#2 lore raw

PATCH v2 3/3 arm: rmobile: Add support lager board

In reply to Nobuhiro Iwamatsu

The lager board has R8A7790, 2GB DDR3-SDRAM, USB,
Ethernet, and more.

This patch supports the following functions:
- DDR3-SDRAM
- SCIF
- QSPI
- Ethernet

---
v2: Remove changes for mach-types.h.
Rebase boards.cfg.

 board/renesas/lager/Makefile |   35 ++
 board/renesas/lager/lager.c  |  357 ++++++++++++++
 board/renesas/lager/qos.c    | 1112 ++++++++++++++++++++++++++++++++++++++++++
 board/renesas/lager/qos.h    |   12 +
 boards.cfg                   |    2 +
 include/configs/lager.h      |  188 +++++++
 6 files changed, 1706 insertions(+)
 create mode 100644 board/renesas/lager/Makefile
 create mode 100644 board/renesas/lager/lager.c
 create mode 100644 board/renesas/lager/qos.c
 create mode 100644 board/renesas/lager/qos.h
 create mode 100644 include/configs/lager.h
board/renesas/lager/Makefile new file +35 -0
new file mode 100644
index 0000000..acf2ebe
@@ -0,0 +1,35 @@
+#
+# board/renesas/lager/Makefile
+#
+# Copyright (C) 2013 Renesas Electronics Corporation
+#
+# SPDX-License-Identifier: GPL-2.0
+#
+
+include	$(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(BOARD).o
+
+COBJS	:= lager.o qos.o
+
+SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+SOBJS	:= $(addprefix $(obj),$(SOBJS))
+
+$(LIB): $(obj).depend $(OBJS) $(SOBJS)
+	$(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+clean:
+	rm -f $(SOBJS) $(OBJS)
+
+distclean:	clean
+	rm -f $(LIB) core *.bak $(obj).depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
board/renesas/lager/lager.c new file +357 -0

357 lines not on this page · raw message

board/renesas/lager/qos.c new file +1112 -0

1,112 lines not on this page · raw message

board/renesas/lager/qos.h new file +12 -0
new file mode 100644
index 0000000..9a6c046
@@ -0,0 +1,12 @@
+/*
+ * Copyright (C) 2013 Renesas Electronics Corporation
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#ifndef __QOS_H__
+#define __QOS_H__
+
+void qos_init(void);
+
+#endif
boards.cfg +2 -0
index dbd8479..f1dfae8 100644
@@ -333,6 +333,8 @@ Active  arm         armv7          omap5       ti              dra7xx
 Active  arm         armv7          omap5       ti              omap5_uevm          omap5_uevm                           -                                                                                                                                 -
 Active  arm         armv7          rmobile     atmark-techno   armadillo-800eva    armadillo-800eva                     -                                                                                                                                 Nobuhiro Iwamatsu <[email protected]>
 Active  arm         armv7          rmobile     kmc             kzm9g               kzm9g                                -                                                                                                                                 Nobuhiro Iwamatsu <[email protected]>:Tetsuyuki Kobayashi <[email protected]>
+Active  arm         armv7          rmobile     renesas         lager               lager                                -                                                                                                                                 Nobuhiro Iwamatsu <[email protected]>
+Active  arm         armv7          rmobile     renesas         lager               lager_nor                            lager:NORFLASH                                                                                                                    Nobuhiro Iwamatsu <[email protected]>
 Active  arm         armv7          s5pc1xx     samsung         goni                s5p_goni                             -                                                                                                                                 Minkyu Kang <[email protected]>
 Active  arm         armv7          s5pc1xx     samsung         smdkc100            smdkc100                             -                                                                                                                                 Minkyu Kang <[email protected]>
 Active  arm         armv7          socfpga     altera          socfpga             socfpga_cyclone5                     -                                                                                                                                 -
include/configs/lager.h new file +188 -0

188 lines not on this page · raw message

Signature · 1 line
1.8.4.rc3
#3 lore raw

PATCH v2 3/3 arm: rmobile: Add support lager board

Hi Nobuhiro,

Quoted 9 lines · Nobuhiro Iwamatsu

The lager board has R8A7790, 2GB DDR3-SDRAM, USB,
Ethernet, and more.

This patch supports the following functions:
- DDR3-SDRAM
- SCIF
- QSPI
- Ethernet

Quoted 7 lines

---
v2: Remove changes for mach-types.h.
Rebase boards.cfg.

This fails to build under current u-boot-arm/master. Can you please verify?

Amicalement,

Signature · 1 line
Albert.
#4 lore raw

PATCH v2 3/3 arm: rmobile: Add support lager board

Hi,

2013/10/17 Albert ARIBAUD <[email protected]>:

Quoted 22 lines

Hi Nobuhiro,

Quoted 9 lines · Nobuhiro Iwamatsu

The lager board has R8A7790, 2GB DDR3-SDRAM, USB,
Ethernet, and more.

This patch supports the following functions:
- DDR3-SDRAM
- SCIF
- QSPI
- Ethernet

Quoted 7 lines

---
v2: Remove changes for mach-types.h.
Rebase boards.cfg.

Quoted 2 lines

This fails to build under current u-boot-arm/master. Can you please verify?

I see.
I removed some config of devices. These device does not applied to u-boot/master yet.
And "arm: rmobile: Add support r8a7790" can not send to ML (but I CCed to you) and
can not show in patchwork, because this patch is too big to ML.

I already send fixed patches.
Could you check with new patches?

Quoted 4 lines

Amicalement,
--
Albert.

Best regards,
Nobuhiro

Signature · 1 line
Nobuhiro Iwamatsu