Re: [U-Boot] [PATCH 14/28] SPEAr : Basic spear1300 architecture support added

2010-07-15 Thread Wolfgang Denk
Dear Vipin KUMAR,

In message 1279084204-3263-15-git-send-email-vipin.ku...@st.com you wrote:
 From: Vipin KUMAR vipin.ku...@st.com
 
 SPEAr1300 is an ARMCortexA9 dual core based SoC which supports
 multiple peripherals such as
...
 + printf(System is going to reboot ...\n);
 +
 + /*
 +  * This 1 second delay will allow the above message
 +  * to be printed before reset
 +  */
 + udelay((1000 * 1000));

udelay() is not designed to provide such long delays. This may or
may not work - it's bad style in any case.

Also, do we really need one second to print 30 characters? 

And hey, why do you print this at all?  Please remove the printf()
_and_ the delay.


...
 +/* load related definitions */
 +#define FREE_RUNNING (0x)
 +
 +#define CONFIG_SPEARCA9_HZ_CLK   (25000)

No parens needed in these #defines (please check and fix globally).

...
 --- /dev/null
 +++ b/arch/arm/include/asm/arch-spear13xx/sys_proto.h
 @@ -0,0 +1,34 @@

Drop that header file, and move the prototypes to some other suitable
header.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Quote from the Boss... I didn't say it was your fault.  I said I was
going to blame it on you.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 14/28] SPEAr : Basic spear1300 architecture support added

2010-07-13 Thread Vipin KUMAR
From: Vipin KUMAR vipin.ku...@st.com

SPEAr1300 is an ARMCortexA9 dual core based SoC which supports
multiple peripherals such as

1. Ethernet Controller
2. USB Device Controller
3. USB Host Controllers
4. MTD interfaces for NAND and NOR(serial and parallel) flash devices
etc

For more information, visit www.st.com/spear

This patch adds the architecture support for spear1300.

Signed-off-by: Vipin Kumar vipin.ku...@st.com
---
 arch/arm/cpu/arm_cortexa8/spear13xx/Makefile |   52 
 arch/arm/cpu/arm_cortexa8/spear13xx/ca9_ltimer.c |  136 +
 arch/arm/cpu/arm_cortexa8/spear13xx/cache.S  |  114 
 arch/arm/cpu/arm_cortexa8/spear13xx/cpu.c|   96 +++
 arch/arm/cpu/arm_cortexa8/spear13xx/reset.c  |   47 
 arch/arm/include/asm/arch-spear13xx/ca9_ltimer.h |   43 +++
 arch/arm/include/asm/arch-spear13xx/hardware.h   |   42 +++
 arch/arm/include/asm/arch-spear13xx/spr_misc.h   |  317 ++
 arch/arm/include/asm/arch-spear13xx/sys_proto.h  |   34 +++
 9 files changed, 881 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/cpu/arm_cortexa8/spear13xx/Makefile
 create mode 100644 arch/arm/cpu/arm_cortexa8/spear13xx/ca9_ltimer.c
 create mode 100644 arch/arm/cpu/arm_cortexa8/spear13xx/cache.S
 create mode 100644 arch/arm/cpu/arm_cortexa8/spear13xx/cpu.c
 create mode 100755 arch/arm/cpu/arm_cortexa8/spear13xx/reset.c
 create mode 100644 arch/arm/include/asm/arch-spear13xx/ca9_ltimer.h
 create mode 100644 arch/arm/include/asm/arch-spear13xx/hardware.h
 create mode 100644 arch/arm/include/asm/arch-spear13xx/spr_misc.h
 create mode 100644 arch/arm/include/asm/arch-spear13xx/sys_proto.h

diff --git a/arch/arm/cpu/arm_cortexa8/spear13xx/Makefile 
b/arch/arm/cpu/arm_cortexa8/spear13xx/Makefile
new file mode 100644
index 000..a1e17d4
--- /dev/null
+++ b/arch/arm/cpu/arm_cortexa8/spear13xx/Makefile
@@ -0,0 +1,52 @@
+#
+# (C) Copyright 2000-2003
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# (C) Copyright 2008
+# Guennadi Liakhovetki, DENX Software Engineering, l...@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 $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(SOC).a
+
+COBJS  += ca9_ltimer.o
+COBJS  += cpu.o
+COBJS  += reset.o
+
+SOBJS  = cache.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
+
+all:$(obj).depend $(LIB)
+
+$(LIB):$(OBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/arch/arm/cpu/arm_cortexa8/spear13xx/ca9_ltimer.c 
b/arch/arm/cpu/arm_cortexa8/spear13xx/ca9_ltimer.c
new file mode 100644
index 000..4a23390
--- /dev/null
+++ b/arch/arm/cpu/arm_cortexa8/spear13xx/ca9_ltimer.c
@@ -0,0 +1,136 @@
+/*
+ * (C) Copyright 2010
+ * Vipin Kumar, ST Micoelectronics, vipin.ku...@st.com.
+ *
+ * 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 asm/io.h
+#include asm/arch/hardware.h
+#include asm/arch/ca9_ltimer.h
+
+#define PRESCALER  PRESCALER_249
+#define TIMER_TICKS(CONFIG_SPEARCA9_HZ_CLK / (PRESCALER + 1))
+#define TIMER_RES  (TIMER_TICKS / CONFIG_SYS_HZ)
+#define READ_TIMER()   readl(ca9_timer_p-count)
+
+static struct ca9_timer_regs *const ca9_timer_p =
+(struct ca9_timer_regs