Re: [U-Boot-Users] [PATCH 7/7 v6] ARM: Add support for S3C6400 based SMDK6400 board

2008-08-09 Thread Jean-Christophe PLAGNIOL-VILLARD
On 21:42 Wed 06 Aug , Guennadi Liakhovetski wrote:
 SMDK6400 can only boot U-Boot from NAND-flash. This patch adds a nand_spl
 driver for it too. The board can also boot from the NOR flash, but due to
 hardware limitations it can only address 64KiB on it, which is not enough
 for U-Boot. Based on the original sources by Samsung for U-Boot 1.1.6.
 
 Signed-off-by: Guennadi Liakhovetski [EMAIL PROTECTED]
 ---
 
 Changes since v5: adjust the configuration to more precisely desribe NAND 
 ECC layout.
 
  MAKEALL|1 +
  Makefile   |   17 ++
please add your entry in MAINTAINERS
  board/samsung/smdk6400/Makefile|   54 +
  board/samsung/smdk6400/config.mk   |   30 +++
  board/samsung/smdk6400/lowlevel_init.S |  316 
 
  board/samsung/smdk6400/smdk6400.c  |  130 
  board/samsung/smdk6400/u-boot-nand.lds |   62 ++
  include/configs/smdk6400.h |  306 +++
  nand_spl/board/samsung/smdk6400/Makefile   |  106 ++
  nand_spl/board/samsung/smdk6400/config.mk  |   40 
  nand_spl/board/samsung/smdk6400/u-boot.lds |   61 ++
  11 files changed, 1123 insertions(+), 0 deletions(-)
  create mode 100644 board/samsung/smdk6400/Makefile
  create mode 100644 board/samsung/smdk6400/config.mk
  create mode 100644 board/samsung/smdk6400/lowlevel_init.S
  create mode 100644 board/samsung/smdk6400/smdk6400.c
  create mode 100644 board/samsung/smdk6400/u-boot-nand.lds
  create mode 100644 include/configs/smdk6400.h
  create mode 100644 nand_spl/board/samsung/smdk6400/Makefile
  create mode 100644 nand_spl/board/samsung/smdk6400/config.mk
  create mode 100644 nand_spl/board/samsung/smdk6400/u-boot.lds

 +# 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$(BOARD).a
 +
 +COBJS:= smdk6400.o
 +SOBJS:= lowlevel_init.o
 +OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
 +
 +$(LIB):  $(obj).depend $(OBJS)
 + $(AR) crv $@ $(OBJS)
 +

please keep this Makefile as other new style

ex from atmel board

include $(TOPDIR)/config.mk

LIB = $(obj)lib$(BOARD).a

COBJS-y += at91cap9adk.o
COBJS-y += led.o
COBJS-y += partition.o
COBJS-$(CONFIG_CMD_NAND) += nand.o

SRCS:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
OBJS:= $(addprefix $(obj),$(COBJS-y))
SOBJS   := $(addprefix $(obj),$(SOBJS))

$(LIB): $(obj).depend $(OBJS) $(SOBJS)
$(AR) $(ARFLAGS) $@ $(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

#
 diff --git a/board/samsung/smdk6400/config.mk 
 b/board/samsung/smdk6400/config.mk
 new file mode 100644
 index 000..298d387
 --- /dev/null
 +++ b/board/samsung/smdk6400/config.mk
 @@ -0,0 +1,30 @@
 +#
 +# (C) Copyright 2002
 +# Gary Jennejohn, DENX Software Engineering, [EMAIL PROTECTED]
 +# David Mueller, ELSOFT AG, [EMAIL PROTECTED]
 +#
 +# (C) Copyright 2008
 +# Guennadi Liakhovetki, DENX Software Engineering, [EMAIL PROTECTED]
 +#
 +# SAMSUNG SMDK6400 board with mDirac3 (ARM1176) cpu
 +#
 +# see http://www.samsung.com/ for more information on SAMSUNG
 +
 +# On SMDK6400 we use the 64 MB SDRAM bank at
 +#
 +# 0x5000 to 0x5800
 +#
 +# Linux-Kernel is expected to be at 0x50008000, entry 0x50008000
 +#
 +# we load ourselves to 0x57e0 without MMU
 +# with MMU, load address is changed to 0xc7e0
 +#
 +# download area is 0x5000c000
 +
 +sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
 +
 +ifndef CONFIG_NAND_SPL
 +TEXT_BASE = $(RAM_TEXT)
 +else
 +TEXT_BASE = 0
 +endif
 +check_syncack:
 + ldr r1, [r0, #OTHERS_OFFSET]
 + ldr r2, =0xf00
 + and r1, r1, r2
 + cmp r1, #0xf00
 + bne check_syncack
 +#else/* ASYNC Mode */
please use .rept
 + nop
 + nop
 + nop
 + nop
 + nop
 +
and please be carefull with whitespaces
 index 000..77fd2c8
 --- /dev/null
 +++ b/board/samsung/smdk6400/smdk6400.c
 @@ -0,0 +1,130 @@
 +/*
 +static inline void delay(unsigned long loops)
 +{
 + __asm__ volatile (1:\n subs %0, %1, #1\n
 +   bne 1b
 +   : =r (loops) : 0 (loops));
 +}
 +
 +/*
 + * Miscellaneous platform dependent initialisations
 + */
 +
 +{
 + nand_probe(CFG_NAND_BASE);
 + if (nand_dev_desc[0].ChipID != NAND_ChipID_UNKNOWN)
 + print_size(nand_dev_desc[0].totlen, 

[U-Boot-Users] [PATCH 7/7 v6] ARM: Add support for S3C6400 based SMDK6400 board

2008-08-06 Thread Guennadi Liakhovetski
SMDK6400 can only boot U-Boot from NAND-flash. This patch adds a nand_spl
driver for it too. The board can also boot from the NOR flash, but due to
hardware limitations it can only address 64KiB on it, which is not enough
for U-Boot. Based on the original sources by Samsung for U-Boot 1.1.6.

Signed-off-by: Guennadi Liakhovetski [EMAIL PROTECTED]
---

Changes since v5: adjust the configuration to more precisely desribe NAND 
ECC layout.

 MAKEALL|1 +
 Makefile   |   17 ++
 board/samsung/smdk6400/Makefile|   54 +
 board/samsung/smdk6400/config.mk   |   30 +++
 board/samsung/smdk6400/lowlevel_init.S |  316 
 board/samsung/smdk6400/smdk6400.c  |  130 
 board/samsung/smdk6400/u-boot-nand.lds |   62 ++
 include/configs/smdk6400.h |  306 +++
 nand_spl/board/samsung/smdk6400/Makefile   |  106 ++
 nand_spl/board/samsung/smdk6400/config.mk  |   40 
 nand_spl/board/samsung/smdk6400/u-boot.lds |   61 ++
 11 files changed, 1123 insertions(+), 0 deletions(-)
 create mode 100644 board/samsung/smdk6400/Makefile
 create mode 100644 board/samsung/smdk6400/config.mk
 create mode 100644 board/samsung/smdk6400/lowlevel_init.S
 create mode 100644 board/samsung/smdk6400/smdk6400.c
 create mode 100644 board/samsung/smdk6400/u-boot-nand.lds
 create mode 100644 include/configs/smdk6400.h
 create mode 100644 nand_spl/board/samsung/smdk6400/Makefile
 create mode 100644 nand_spl/board/samsung/smdk6400/config.mk
 create mode 100644 nand_spl/board/samsung/smdk6400/u-boot.lds

diff --git a/MAKEALL b/MAKEALL
index ee83cca..a3ed47d 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -515,6 +515,7 @@ LIST_ARM11=\
imx31_litekit   \
imx31_phycore   \
mx31ads \
+   smdk6400\
 
 
 #
diff --git a/Makefile b/Makefile
index cb8c0f5..898b3f6 100644
--- a/Makefile
+++ b/Makefile
@@ -2686,6 +2686,23 @@ mx31ads_config   : unconfig
 omap2420h4_config  : unconfig
@$(MKCONFIG) $(@:_config=) arm arm1136 omap2420h4 NULL omap24xx
 
+#
+## ARM1176 Systems
+#
+smdk6400_noUSB_config  \
+smdk6400_config:   unconfig
+   @mkdir -p $(obj)include $(obj)board/samsung/smdk6400
+   @mkdir -p $(obj)nand_spl/board/samsung/smdk6400
+   @echo #define CONFIG_NAND_U_BOOT  $(obj)include/config.h
+   @if [ -z $(findstring smdk6400_noUSB_config,$@) ]; then   
\
+   echo RAM_TEXT = 0x57e0  
$(obj)board/samsung/smdk6400/config.tmp;\
+   $(MKCONFIG) $(@:_config=) arm arm1176 smdk6400 samsung s3c64xx; 
\
+   else
\
+   echo RAM_TEXT = 0xc7e0  
$(obj)board/samsung/smdk6400/config.tmp;\
+   $(MKCONFIG) $(@:_noUSB_config=) arm arm1176 smdk6400 samsung 
s3c64xx;   \
+   fi
+   @echo CONFIG_NAND_U_BOOT = y  $(obj)include/config.mk
+
 #
 # i386
 #
diff --git a/board/samsung/smdk6400/Makefile b/board/samsung/smdk6400/Makefile
new file mode 100644
index 000..d35dc8b
--- /dev/null
+++ b/board/samsung/smdk6400/Makefile
@@ -0,0 +1,54 @@
+#
+# (C) Copyright 2000, 2001, 2002
+# Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED]
+#
+# (C) Copyright 2008
+# Guennadi Liakhovetki, DENX Software Engineering, [EMAIL PROTECTED]
+#
+# 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$(BOARD).a
+
+COBJS  := smdk6400.o
+SOBJS  := lowlevel_init.o
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(AR) crv $@ $(OBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+