[U-Boot-Users] [PATCH 1/8] [SH] SuperH support

Nobuhiro Iwamatsu iwamatsu at nigauri.org
Sun May 6 22:14:19 CEST 2007


Hi, all.

I wrote the code in which u-boot was supported for SH [0]. 
I am maintaining SH-IPL+g[1] that is the boot loader only for SH now. 
However, I think that I will maintain u-boot in the future.

Now,
0. SDRAM controler
1. Internal serial device
2. Flash
3. Timer
working.

I plan to adopt it as a boot loader of the main in the future though 
only several boards are supported now. 

Please apply this patch .

regards,
 Nobuhiro

[0] : http://america.renesas.com/fmwk.jsp?cnt=superh_family_landing.jsp&fp=/products/mpumcu/superh_family
[1] : http://git.nigauri.org

-- 
Nobuhiro Iwamatsu
	E-Mail : iwamatsu at nigauri.org
	GPG ID : 3170EBE9 

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu at nigauri.org>

diff --git a/Makefile b/Makefile
index ceee2c7..1735e9c 100644
--- a/Makefile
+++ b/Makefile
@@ -151,6 +151,9 @@ endif
 ifeq ($(ARCH),avr32)
 CROSS_COMPILE = avr32-linux-
 endif
+ifeq ($(ARCH),sh)
+CROSS_COMPILE = sh4-linux-
+endif
 endif
 endif
 
diff --git a/CREDITS b/CREDITS
index 7af1b80..e94372d 100644
--- a/CREDITS
+++ b/CREDITS
@@ -479,3 +479,8 @@ N: Michal Simek
 E: monstr at monstr.eu
 D: Support for Microblaze, ML401, XUPV2P board
 W: www.monstr.eu
+
+N: Nobuhiro Iwamatsu
+E: iwamatsu at nigauri.org
+D: Support for SuperH, MS7750SE01  board
+W: www.nigauri.org
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index a6499e8..8af0589 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -267,6 +267,8 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 	if (hdr->ih_arch != IH_CPU_NIOS2)
 #elif defined(__PPC__)
 	if (hdr->ih_arch != IH_CPU_PPC)
+#elif defined(__sh__)
+	if (hdr->ih_arch != IH_CPU_SH)
 #else
 # error Unknown CPU type
 #endif
diff --git a/cpu/sh4/Makefile b/cpu/sh4/Makefile
new file mode 100644
index 0000000..b24a280
--- /dev/null
+++ b/cpu/sh4/Makefile
@@ -0,0 +1,46 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# (C) Copyright 2007
+# Nobuhiro Iwamatsu <iwamatsu at nigauri.org>
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(CPU).a
+
+START	= start.o
+OBJS	= cpu.o interrupts.o watchdog.o time.o 
+
+all:	.depend $(START) $(LIB)
+
+$(LIB):	$(OBJS)
+	$(AR) crv $@ $(OBJS)
+
+#########################################################################
+
+.depend:	Makefile $(START:.o=.S) $(OBJS:.o=.c)
+		$(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) > $@
+
+sinclude .depend
+
+#########################################################################
diff --git a/cpu/sh4/config.mk b/cpu/sh4/config.mk
new file mode 100644
index 0000000..2dc7b91
--- /dev/null
+++ b/cpu/sh4/config.mk
@@ -0,0 +1,28 @@
+#
+# (C) Copyright 2000-2004
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# (C) Copyright 2007
+# Nobuhiro Iwamatsu <iwamatsu at nigauri.org>
+#   
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+PLATFORM_CPPFLAGS += -m4-nofpu
+PLATFORM_RELFLAGS += -ffixed-r13
diff --git a/cpu/sh4/cpu.c b/cpu/sh4/cpu.c
new file mode 100644
index 0000000..70df45e
--- /dev/null
+++ b/cpu/sh4/cpu.c
@@ -0,0 +1,67 @@
+/*
+ * (C) Copyright 2007
+ * Nobuhiro Iwamatsu <iwamatsu at nigauri.org>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <command.h>
+
+int checkcpu(void)
+{
+	puts("CPU: SH4\n");
+	return 0;
+}
+
+int cpu_init (void)
+{
+	return 0;
+}
+
+int cleanup_before_linux (void)
+{
+	disable_interrupts();
+	return 0;
+}
+
+int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+	disable_interrupts();
+	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; 
+}





More information about the U-Boot mailing list