From: Jean-Christophe PLAGNIOL-VILLARD Date: Sun, 31 Aug 2008 18:40:52 +0200 Subject: [U-Boot] [PATCH v2] sh: Add support SH2/SH2A which is CPU of Renesas Technology (Re: [U-Boot-Users] [PATCH 1/3] sh: Add support SH2/SH2A which is CPU of Renesas Technology) In-Reply-To: <20080831232052.f42049cf.iwamatsu@nigauri.org> References: <486CDDB1.1000109@renesas.com> <20080830113151.GD6190@game.jcrosoft.org> <20080831232052.f42049cf.iwamatsu@nigauri.org> Message-ID: <20080831164052.GA21660@game.jcrosoft.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 23:20 Sun 31 Aug , Nobuhiro Iwamatsu wrote: > Add support SH2/SH2A basic function. > > Signed-off-by: Nobuhiro Iwamatsu > Signed-off-by: Nobuhiro Iwamatsu > --- > PATCH v2 : > - Apply Jean-Christophe's comments > > cpu/sh2/Makefile | 49 +++++++++++++++++++ > cpu/sh2/cache.c | 112 ++++++++++++++++++++++++++++++++++++++++++++ > cpu/sh2/config.mk | 26 ++++++++++ > cpu/sh2/cpu.c | 98 ++++++++++++++++++++++++++++++++++++++ > cpu/sh2/interrupts.c | 39 +++++++++++++++ > cpu/sh2/start.S | 78 ++++++++++++++++++++++++++++++ > cpu/sh2/time.c | 111 +++++++++++++++++++++++++++++++++++++++++++ > cpu/sh2/watchdog.c | 33 +++++++++++++ > examples/Makefile | 3 + > include/asm-sh/cpu_sh2.h | 40 ++++++++++++++++ > include/asm-sh/processor.h | 5 ++- > 11 files changed, 593 insertions(+), 1 deletions(-) > create mode 100644 cpu/sh2/Makefile > create mode 100644 cpu/sh2/cache.c > create mode 100644 cpu/sh2/config.mk > create mode 100644 cpu/sh2/cpu.c > create mode 100644 cpu/sh2/interrupts.c > create mode 100644 cpu/sh2/start.S > create mode 100644 cpu/sh2/time.c > create mode 100644 cpu/sh2/watchdog.c > create mode 100644 include/asm-sh/cpu_sh2.h > > diff --git a/cpu/sh2/Makefile b/cpu/sh2/Makefile > new file mode 100644 > index 0000000..50f6720 > --- /dev/null > +++ b/cpu/sh2/Makefile > @@ -0,0 +1,49 @@ > +# > +# (C) Copyright 2000-2006 > +# Wolfgang Denk, DENX Software Engineering, wd at denx.de. > +# > +# Copyright (C) 2007,2008 Nobuhiro Iwamatsu > +# Copyright (C) 2008 Renesas Solutions Corp. > +# > +# 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 # cache.o > + > +all: .depend $(START) $(LIB) please use $(obj).depend > + > +$(LIB): $(OBJS) > + $(AR) $(ARFLAGS) $@ $(OBJS) > + > +######################################################################### > + > +.depend: Makefile $(START:.o=.S) $(OBJS:.o=.c) > + $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) > $@ please remove > + > +# defines $(obj).depend target > +include $(SRCTREE)/rules.mk > + > +sinclude $(obj).depend > + > +######################################################################### > +/* > + * Copyright (C) 2007,2008 Nobuhiro Iwamatsu > + * Copyright (C) 2008 Renesas Solutions Corp. > + * > + * 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 > +#include > +#include > +#include > + > +#define STBCR4 0xFFFE040C ^^^^^^ whitespace > +#define cmt_clock_enable() do {\ > + writeb(readb(STBCR4) & ~0x04, STBCR4);\ > + } while (0) > +#define scif0_enable() do {\ > + writeb(readb(STBCR4) & ~0x80, STBCR4);\ > + } while (0) > + > +++ b/cpu/sh2/time.c > @@ -0,0 +1,111 @@ > +/* > + * Copyright (C) 2007,2008 Nobobuhiro Iwamatsu > + * Copyright (C) 2008 Renesas Solutions Corp. > + * > + * (C) Copyright 2003 > + * Wolfgang Denk, DENX Software Engineering, wd at denx.de. > + * > + * 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 > +#include > +#include > + > +#define CMT_CMCSR_INIT 0x0001 /* PCLK/32 */ ^^ whitespace > +#define CMT_CMCSR_CALIB 0x0000 > +#define CMT_MAX_COUNTER (0xFFFFFFFF) > +#define CMT_TIMER_RESET (0xFFFF) > + > +static vu_long cmt0_timer; > + Best Regards, J.