Skip to contentSkip to conversation

Add target board MS7206SE

PATCH New Yoshinori Sato 2 participants 8 messages Feb 13, 2014 – Jan 30, 2015

Subsystems (3)
lore
Share & tools
lore

Yoshinori Sato

author maintainer
#0 lore raw

v2 cover Add target board MS7206SE

Hi.
I updated MS7206SE support.
Please review and comment

Changes v2
cleanup for checkpatch.pl

Yoshinori Sato (6):
Add MS7206SE support
Add MS7206SE ethernet support
Add SH7206 support
SH2A cache support
Module enabler cleanup
Various update

 arch/sh/config.mk                      |   3 +
 arch/sh/cpu/sh2/Makefile               |   6 ++
 arch/sh/cpu/sh2/cache-sh2a.c           | 145 +++++++++++++++++++++++++++++++++
 arch/sh/cpu/sh2/config.mk              |   4 +-
 arch/sh/cpu/sh2/cpu.c                  |  58 +++----------
 arch/sh/cpu/sh2/nocache.c              |  36 ++++++++
 arch/sh/cpu/sh2/start.S                |   2 +-
 arch/sh/include/asm/cpu_sh2.h          |  15 ++--
 arch/sh/include/asm/cpu_sh2a.h         |  16 ++++
 arch/sh/include/asm/cpu_sh7206.h       |  75 +++++++++++++++++
 board/renesas/ms7206se/Makefile        |  10 +++
 board/renesas/ms7206se/lowlevel_init.S | 124 ++++++++++++++++++++++++++++
 board/renesas/ms7206se/ms7206se.c      |  43 ++++++++++
 boards.cfg                             |   1 +
 drivers/net/smc91111.h                 |  31 ++++++-
 include/configs/ms7206se.h             |  95 +++++++++++++++++++++
 16 files changed, 605 insertions(+), 59 deletions(-)
 create mode 100644 arch/sh/cpu/sh2/cache-sh2a.c
 create mode 100644 arch/sh/cpu/sh2/nocache.c
 create mode 100644 arch/sh/include/asm/cpu_sh2a.h
 create mode 100644 arch/sh/include/asm/cpu_sh7206.h
 create mode 100644 board/renesas/ms7206se/Makefile
 create mode 100644 board/renesas/ms7206se/lowlevel_init.S
 create mode 100644 board/renesas/ms7206se/ms7206se.c
 create mode 100644 include/configs/ms7206se.h
Signature · 1 line
1.8.5.3
author maintainer
#1 lore raw

PATCH v2 1/6 Add MS7206SE support

---
 board/renesas/ms7206se/Makefile        |  10 +++
 board/renesas/ms7206se/lowlevel_init.S | 124 +++++++++++++++++++++++++++++++++
 board/renesas/ms7206se/ms7206se.c      |  43 ++++++++++++
 boards.cfg                             |   1 +
 include/configs/ms7206se.h             |  95 +++++++++++++++++++++++++
 5 files changed, 273 insertions(+)
 create mode 100644 board/renesas/ms7206se/Makefile
 create mode 100644 board/renesas/ms7206se/lowlevel_init.S
 create mode 100644 board/renesas/ms7206se/ms7206se.c
 create mode 100644 include/configs/ms7206se.h
board/renesas/ms7206se/Makefile new file +10 -0
new file mode 100644
index 0000000..eed3769
@@ -0,0 +1,10 @@
+#
+# Copyright (C) 2013 Yoshinori Sato <[email protected]>
+#
+# u-boot/board/renesas/ms7206se/Makefile
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y	:= ms7206se.o
+obj-y	+= lowlevel_init.o
board/renesas/ms7206se/lowlevel_init.S new file +124 -0

124 lines not on this page · raw message

board/renesas/ms7206se/ms7206se.c new file +43 -0

43 lines not on this page · raw message

boards.cfg +1 -0
index c97c4bd..a56f196 100644
@@ -1203,6 +1203,7 @@ Active  powerpc     ppc4xx         -           xilinx          ppc440-generic
 Active  powerpc     ppc4xx         -           xilinx          ppc440-generic      xilinx-ppc440-generic_flash          xilinx-ppc440-generic:SYS_TEXT_BASE=0xF7F60000,RESET_VECTOR_ADDRESS=0xF7FFFFFC                                                    Ricardo Ribalda <[email protected]>
 Active  sandbox     sandbox        -           sandbox         sandbox             sandbox                              -                                                                                                                                 Simon Glass <[email protected]>
 Active  sh          sh2            -           renesas         rsk7203             rsk7203                              -                                                                                                                                 Nobuhiro Iwamatsu <[email protected]>:Nobuhiro Iwamatsu <[email protected]>
+Active  sh          sh2            -           renesas         ms7206se            ms7206se                             -                                                                                                                                 Yoshinori Sato <[email protected]>
 Active  sh          sh2            -           renesas         rsk7264             rsk7264                              -                                                                                                                                 Phil Edworthy <[email protected]>
 Active  sh          sh2            -           renesas         rsk7269             rsk7269                              -                                                                                                                                 -
 Active  sh          sh3            -           -               mpr2                mpr2                                 -                                                                                                                                 Mark Jonas <[email protected]>
include/configs/ms7206se.h new file +95 -0

95 lines not on this page · raw message

Signature · 1 line
1.8.5.3
author maintainer
#2 lore raw

PATCH v2 2/6 Add MS7206SE ethernet support

In reply to Yoshinori Sato
---
 drivers/net/smc91111.h | 31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)
drivers/net/smc91111.h +30 -1
index 9deee9b..24b2b51 100644
@@ -236,7 +236,36 @@ struct smc91111_priv{
 					  *(__b2 + __i) = SMC_inb((a),(r));  \
 					};  \
 				}while(0)
-
+#elif defined(CONFIG_MS7206SE)
+#define SWAB7206(x) ({ word __x = x; ((__x << 8)|(__x >> 8)); })
+#define SMC_inw(a, r) *((volatile word*)((a)->iobase + (r)))
+#define SMC_inb(a, r) (*((volatile byte*)((a)->iobase + ((r) ^ 0x01))))
+#define SMC_insw(a, r, b, l) \
+	do { \
+		int __i; \
+		word *__b2 = (word *)(b);		  \
+		for (__i = 0; __i < (l); __i++) { \
+			*__b2++ = SWAB7206(SMC_inw(a, r));	\
+		} \
+	} while (0)
+#define	SMC_outw(a, d, r)	(*((volatile word *)((a)->iobase+(r))) = d)
+#define	SMC_outb(a, d, r)	({	word __d = (byte)(d);  \
+				word __w = SMC_inw((a), ((r)&(~1)));	\
+				if (((r) & 1)) \
+					__w = (__w & 0x00ff) | (__d << 8); \
+				else \
+					__w = (__w & 0xff00) | (__d); \
+				SMC_outw((a), __w, ((r)&(~1)));	      \
+			})
+#define SMC_outsw(a, r, b, l) \
+	do { \
+		int __i; \
+		word *__b2 = (word *)(b);		  \
+		for (__i = 0; __i < (l); __i++) { \
+			SMC_outw(a, SWAB7206(*__b2), r);	  \
+			__b2++; \
+		} \
+	} while (0)
 #else			/* if not CONFIG_CPU_PXA25X and not CONFIG_LEON */
 
 #ifndef CONFIG_SMC_USE_IOFUNCS /* these macros don't work on some boards */
Signature · 1 line
1.8.5.3
author maintainer
#4 lore raw

PATCH v2 3/6 Add SH7206 support

In reply to Yoshinori Sato
---
 arch/sh/include/asm/cpu_sh2.h    |  2 ++
 arch/sh/include/asm/cpu_sh7206.h | 75 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+)
 create mode 100644 arch/sh/include/asm/cpu_sh7206.h
arch/sh/include/asm/cpu_sh2.h +2 -0
index 18a0f0b..ca7b630 100644
@@ -20,6 +20,8 @@
 
 #if defined(CONFIG_CPU_SH7203)
 # include <asm/cpu_sh7203.h>
+#elif defined(CONFIG_CPU_SH7206)
+# include <asm/cpu_sh7206.h>
 #elif defined(CONFIG_CPU_SH7264)
 # include <asm/cpu_sh7264.h>
 #elif defined(CONFIG_CPU_SH7269)
arch/sh/include/asm/cpu_sh7206.h new file +75 -0

75 lines not on this page · raw message

Signature · 1 line
1.8.5.3
author maintainer
#5 lore raw

PATCH v2 4/6 SH2A cache support

In reply to Yoshinori Sato
---
 arch/sh/cpu/sh2/Makefile      |   6 ++
 arch/sh/cpu/sh2/cache-sh2a.c  | 145 ++++++++++++++++++++++++++++++++++++++++++
 arch/sh/cpu/sh2/cpu.c         |  31 ---------
 arch/sh/cpu/sh2/nocache.c     |  36 +++++++++++
 arch/sh/include/asm/cpu_sh2.h |  10 ---
 5 files changed, 187 insertions(+), 41 deletions(-)
 create mode 100644 arch/sh/cpu/sh2/cache-sh2a.c
 create mode 100644 arch/sh/cpu/sh2/nocache.c
arch/sh/cpu/sh2/Makefile +6 -0
index a19ed5e..6a11448 100644
@@ -4,9 +4,15 @@
 #
 # Copyright (C) 2007,2008 Nobuhiro Iwamatsu <[email protected]>
 # Copyright (C) 2008 Renesas Solutions Corp.
+# Copyright (C) 2013 Yoshinori Sato <[email protected]>
 #
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
 extra-y	= start.o
 obj-y	= cpu.o interrupts.o watchdog.o
+ifdef CONFIG_SH2A
+obj-y	+= cache-sh2a.o
+else
+obj-y	+= nocache.o
+endif
arch/sh/cpu/sh2/cache-sh2a.c new file +145 -0

145 lines not on this page · raw message

arch/sh/cpu/sh2/cpu.c +0 -31
index a2f856f..b401d08 100644
@@ -52,34 +52,3 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	reset_cpu(0);
 	return 0;
 }
-
-void flush_cache(unsigned long addr, unsigned long size)
-{
-
-}
-
-void icache_enable(void)
-{
-}
-
-void icache_disable(void)
-{
-}
-
-int icache_status(void)
-{
-	return 0;
-}
-
-void dcache_enable(void)
-{
-}
-
-void dcache_disable(void)
-{
-}
-
-int dcache_status(void)
-{
-	return 0;
-}
arch/sh/cpu/sh2/nocache.c new file +36 -0
new file mode 100644
index 0000000..29a8858
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2013 Yoshinori Sato <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+/* dummy cache control functions */
+void flush_cache(unsigned long addr, unsigned long size)
+{
+}
+
+void icache_enable(void)
+{
+}
+
+void icache_disable(void)
+{
+}
+
+int icache_status(void)
+{
+	return 0;
+}
+
+void dcache_enable(void)
+{
+}
+
+void dcache_disable(void)
+{
+}
+
+int dcache_status(void)
+{
+	return 0;
+}
arch/sh/include/asm/cpu_sh2.h +0 -10
index ca7b630..b84dad4 100644
@@ -8,16 +8,6 @@
 #ifndef _ASM_CPU_SH2_H_
 #define _ASM_CPU_SH2_H_
 
-/* cache control */
-#define CCR_CACHE_STOP		0x00000008
-#define CCR_CACHE_ENABLE	0x00000005
-#define CCR_CACHE_ICI		0x00000008
-
-#define CACHE_OC_ADDRESS_ARRAY	0xf0000000
-#define CACHE_OC_WAY_SHIFT	13
-#define CACHE_OC_NUM_ENTRIES	256
-#define CACHE_OC_ENTRY_SHIFT	4
-
 #if defined(CONFIG_CPU_SH7203)
 # include <asm/cpu_sh7203.h>
 #elif defined(CONFIG_CPU_SH7206)
Signature · 1 line
1.8.5.3
author maintainer
#6 lore raw

PATCH v2 5/6 Module enabler cleanup

In reply to Yoshinori Sato
---
 arch/sh/cpu/sh2/cpu.c          | 27 ++++++++++++---------------
 arch/sh/include/asm/cpu_sh2.h  |  3 +++
 arch/sh/include/asm/cpu_sh2a.h | 16 ++++++++++++++++
 3 files changed, 31 insertions(+), 15 deletions(-)
 create mode 100644 arch/sh/include/asm/cpu_sh2a.h
arch/sh/cpu/sh2/cpu.c +12 -15
index b401d08..0a6a58b 100644
@@ -10,16 +10,17 @@
 #include <asm/processor.h>
 #include <asm/io.h>
 
-#define STBCR4      0xFFFE040C
-#define cmt_clock_enable() do {\
-		writeb(readb(STBCR4) & ~0x04, STBCR4);\
-	} while (0)
-#define scif0_enable() do {\
-		writeb(readb(STBCR4) & ~0x80, STBCR4);\
-	} while (0)
-#define scif3_enable() do {\
-		writeb(readb(STBCR4) & ~0x10, STBCR4);\
-	} while (0)
+#if defined(CONFIG_CONS_SCIF0)
+# define CH 0
+#elif defined(CONFIG_CONS_SCIF1)
+# define CH 1
+#elif defined(CONFIG_CONS_SCIF2)
+# define CH 2
+#elif defined(CONFIG_CONS_SCIF3)
+# define CH 3
+#else
+# error "Default SCIF doesn't set....."
+#endif
 
 int checkcpu(void)
 {
@@ -30,11 +31,7 @@ int checkcpu(void)
 int cpu_init(void)
 {
 	/* SCIF enable */
-#if defined(CONFIG_CONS_SCIF3)
-	scif3_enable();
-#else
-	scif0_enable();
-#endif
+	scif_enable(CH);
 	/* CMT clock enable */
 	cmt_clock_enable() ;
 	return 0;
arch/sh/include/asm/cpu_sh2.h +3 -0
index b84dad4..deadece 100644
@@ -8,6 +8,9 @@
 #ifndef _ASM_CPU_SH2_H_
 #define _ASM_CPU_SH2_H_
 
+#if defined(CONFIG_SH2A)
+#  include <asm/cpu_sh2a.h>
+#endif
 #if defined(CONFIG_CPU_SH7203)
 # include <asm/cpu_sh7203.h>
 #elif defined(CONFIG_CPU_SH7206)
arch/sh/include/asm/cpu_sh2a.h new file +16 -0
new file mode 100644
index 0000000..7262a2a
@@ -0,0 +1,16 @@
+#ifndef _ASM_CPU_SH2A_H_
+#define _ASM_CPU_SH2A_H_
+
+/* module enable */
+#define STBCR4		0xFFFE040C
+#define scif_enable(ch)					\
+do {							\
+	if (ch < 4) {					\
+		unsigned char mask = 1 << (7 - ch);	\
+		writeb((readb(STBCR4) & ~mask), STBCR4);\
+	}						\
+} while (0)
+
+#define cmt_clock_enable() \
+	writeb((readb(STBCR4) & ~0x04), STBCR4)
+#endif
Signature · 1 line
1.8.5.3
author maintainer
#7 lore raw

PATCH v2 6/6 Various update

In reply to Yoshinori Sato
---
 arch/sh/config.mk         | 3 +++
 arch/sh/cpu/sh2/config.mk | 4 +++-
 arch/sh/cpu/sh2/start.S   | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)
arch/sh/config.mk +3 -0
index 758c070..abd419a 100644
@@ -11,6 +11,9 @@ CONFIG_STANDALONE_LOAD_ADDR ?= 0x8C000000
 ifeq ($(CPU),sh2)
 CONFIG_STANDALONE_LOAD_ADDR += -EB
 endif
+ifeq ($(CPU),sh2a)
+CONFIG_STANDALONE_LOAD_ADDR += -m2a-nofpu
+endif
 
 PLATFORM_CPPFLAGS += -DCONFIG_SH -D__SH__
 PLATFORM_LDFLAGS += -e $(CONFIG_SYS_TEXT_BASE) --defsym reloc_dst=$(CONFIG_SYS_TEXT_BASE)
arch/sh/cpu/sh2/config.mk +3 -1
index 69273b4..a012162 100644
@@ -8,7 +8,7 @@
 ENDIANNESS += -EB
 
 ifdef CONFIG_SH2A
-PLATFORM_CPPFLAGS += -m2a -m2a-nofpu -mb -ffreestanding
+PLATFORM_CPPFLAGS += -m2a-nofpu -mb -ffreestanding
 else # SH2
 PLATFORM_CPPFLAGS += -m3e -mb
 endif
@@ -16,3 +16,5 @@ PLATFORM_CPPFLAGS += -DCONFIG_SH2 $(call cc-option,-mno-fdpic)
 
 PLATFORM_RELFLAGS += -ffixed-r13
 PLATFORM_LDFLAGS += $(ENDIANNESS)
+
+USE_PRIVATE_LIBGCC = yes
arch/sh/cpu/sh2/start.S +1 -1
index 5b92a01..efda8e2 100644
@@ -14,7 +14,7 @@
 
 	.global	_start
 _sh_start:
-	.long 0x00000010	/* Ppower ON reset PC*/
+	.long 0x00000010	/* Power ON reset PC*/
 	.long 0x00000000
 	.long 0x00000010	/* Manual reset PC */
 	.long 0x00000000
Signature · 1 line
1.8.5.3