public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH 7/7 v6] ARM: Add support for S3C6400 based SMDK6400	board
Date: Sat, 9 Aug 2008 11:32:10 +0200	[thread overview]
Message-ID: <20080809093210.GE18040@game.jcrosoft.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0808062135210.27004@axis700.grange>

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 <lg@denx.de>
> ---
> 
> 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 0000000..298d387
> --- /dev/null
> +++ b/board/samsung/smdk6400/config.mk
> @@ -0,0 +1,30 @@
> +#
> +# (C) Copyright 2002
> +# Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
> +# David Mueller, ELSOFT AG, <d.mueller@elsoft.ch>
> +#
> +# (C) Copyright 2008
> +# Guennadi Liakhovetki, DENX Software Engineering, <lg@denx.de>
> +#
> +# 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
> +#
> +# 0x50000000 to 0x58000000
> +#
> +# Linux-Kernel is expected to be at 0x50008000, entry 0x50008000
> +#
> +# we load ourselves to 0x57e00000 without MMU
> +# with MMU, load address is changed to 0xc7e00000
> +#
> +# 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 0000000..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, "\n");
> +}
> +#endif
> +
> +ulong board_flash_get_legacy (ulong base, int banknum, flash_info_t *info)
> +{
> +	if (banknum == 0) {	/* non-CFI boot flash */
> +		info->portwidth = FLASH_CFI_16BIT;
> +		info->chipwidth = FLASH_CFI_BY16;
> +		info->interface = FLASH_CFI_X16;
> +		return 1;
> +	} else
> +		return 0;
please replace with
	} else {
		return 0;
	}

or
	}

	return 0;
> +}
> diff --git a/include/configs/smdk6400.h b/include/configs/smdk6400.h
> new file mode 100644
> index 0000000..1bc8996
> --- /dev/null
> +++ b/include/configs/smdk6400.h
> @@ -0,0 +1,306 @@
> +/*
> +#define CONFIG_SMDK6400		1	/* on a SAMSUNG SMDK6400 Board  */
> +
> +#define CFG_SDRAM_BASE	0x50000000
> +
> +/* input clock of PLL: SMDK6400 has 12MHz input clock */
> +#define CONFIG_SYS_CLK_FREQ	12000000
> +
> +#if !defined(CONFIG_NAND_SPL) && (TEXT_BASE >= 0xc0000000)
> +#define CONFIG_ENABLE_MMU
> +#endif
> +
> +#define CONFIG_MEMORY_UPPER_CODE
> +
> +#define CONFIG_SETUP_MEMORY_TAGS
> +#define CONFIG_CMDLINE_TAG
> +#define CONFIG_INITRD_TAG
> +
> +/*
> + * Architecture magic and machine type
> + */
> +#define MACH_TYPE		1270
please use mach type from the hearder
> +
> +#define CONFIG_DISPLAY_CPUINFO
> +#define CONFIG_DISPLAY_BOARDINFO
> +
> +#undef CONFIG_SKIP_RELOCATE_UBOOT
> +
> +/*
> + * Size of malloc() pool
> + */
> +#define CFG_MALLOC_LEN		(CFG_ENV_SIZE + 1024 * 1024)
> +#define CFG_GBL_DATA_SIZE	128	/* size in bytes for initial data */
> +
> +/*
> + * Hardware drivers
> + */
> +#define CONFIG_DRIVER_CS8900	1	/* we have a CS8900 on-board	*/
> +#define CS8900_BASE	  	0x18800300
please remove the whitespace
> +#define CS8900_BUS16		1 	/* follow the Linux driver	*/
please remove the whitespace
> +
> +/*
> + * select serial console configuration
> + */
> +#define CONFIG_SERIAL1          1	/* we use SERIAL 1 on SMDK6400	*/
> +
> +#define CFG_HUSH_PARSER			/* use "hush" command parser	*/
> +#ifdef CFG_HUSH_PARSER
do you really want the idef?
> +#define CFG_PROMPT_HUSH_PS2	"> "
> +#endif
> +
> +#define CONFIG_CMDLINE_EDITING
> +
> +/* allow to overwrite serial and ethaddr */
> +#define CONFIG_ENV_OVERWRITE
> +
> +#define CONFIG_BAUDRATE		115200
> +
> +/***********************************************************
> + * Command definition
> + ***********************************************************/
> +#include <config_cmd_default.h>
> +
> +#define CONFIG_CMD_CACHE
> +#define CONFIG_CMD_REGINFO
> +#define CONFIG_CMD_LOADS
> +#define CONFIG_CMD_LOADB
> +#define CONFIG_CMD_ENV
> +#define CONFIG_CMD_NAND
> +#if defined(CONFIG_BOOT_ONENAND)
> +#define CONFIG_CMD_ONENAND
> +#endif
> +#define CONFIG_CMD_PING
> +#define CONFIG_CMD_ELF
> +
> +#define CONFIG_BOOTDELAY	3
> +
> +#define CONFIG_ZERO_BOOTDELAY_CHECK
> +
> +#if (CONFIG_COMMANDS & CONFIG_CMD_KGDB)
replace with
#ifdef CONFIG_CMD_KGDB

> +#define CONFIG_KGDB_BAUDRATE	115200	/* speed to run kgdb serial port */
> +#define CONFIG_KGDB_SER_INDEX	1	/* which serial port to use	 */
> +#endif
> +
> +/*
> + * Miscellaneous configurable options
> + */
> +#define CFG_LONGHELP				/* undef to save memory	      */
> +#define CFG_PROMPT		"SMDK6400 # "	/* Monitor Command Prompt     */
> +#define CFG_CBSIZE		256		/* Console I/O Buffer Size    */
> +#define CFG_PBSIZE		384		/* Print Buffer Size          */
> +#define CFG_MAXARGS		16		/* max number of command args */
> +#define CFG_BARGSIZE		CFG_CBSIZE	/* Boot Argument Buffer Size  */
> +
> +#define CFG_MEMTEST_START	CFG_SDRAM_BASE	/* memtest works on	      */
> +#define CFG_MEMTEST_END		(CFG_SDRAM_BASE + 0x7e00000) /* 126MB in DRAM */
> +
> +#define CFG_LOAD_ADDR		CFG_SDRAM_BASE	/* default load address	*/
> +
> +#define CFG_HZ			1000
> +
> +/* valid baudrates */
> +#define CFG_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, 115200 }
> +
> +/*-----------------------------------------------------------------------
> + * Stack sizes
> + *
> + * The stack sizes are set up in start.S using the settings below
> + */
> +#define CONFIG_STACKSIZE	0x40000		/* regular stack 256KB */
> +
> +/**********************************
> + Support Clock Settings
> + **********************************
> + Setting	SYNC	ASYNC
> + ----------------------------------
> + 667_133_66	 X	  O
> + 533_133_66	 O	  O
> + 400_133_66	 X	  O
> + 400_100_50	 O	  O
> + **********************************/
> +
> +/*#define CONFIG_CLK_667_133_66*/
please remove if not need or use idef
> +#define CONFIG_CLK_533_133_66
> +/*
> +#define CONFIG_CLK_400_100_50
> +#define CONFIG_CLK_400_133_66
> +#define CONFIG_SYNC_MODE
> +*/
Ditto
> +
> +/* SMDK6400 has 2 banks of DRAM, but we use only one in U-Boot */
> +#define CONFIG_NR_DRAM_BANKS	1
> +#define PHYS_SDRAM_1		CFG_SDRAM_BASE	/* SDRAM Bank #1	*/
> +#define CONFIG_BOOT_MOVINAND
> +#define CONFIG_BOOT_ONENAND
> +*/
> +
> diff --git a/nand_spl/board/samsung/smdk6400/Makefile b/nand_spl/board/samsung/smdk6400/Makefile
> new file mode 100644
> index 0000000..ae9eb2a
> --- /dev/null
> +++ b/nand_spl/board/samsung/smdk6400/Makefile
> @@ -0,0 +1,106 @@
> +#
> +# (C) Copyright 2006-2007
> +# Stefan Roese, DENX Software Engineering, sr at denx.de.
> +#
> +# (C) Copyright 2008
> +# Guennadi Liakhovetki, DENX Software Engineering, <lg@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
> +#
> +
> +CONFIG_NAND_SPL	= y
> +
> +include $(TOPDIR)/config.mk
> +include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
> +
> +LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
> +LDFLAGS	= -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
> +AFLAGS	+= -DCONFIG_NAND_SPL
> +CFLAGS	+= -DCONFIG_NAND_SPL
> +
> +SOBJS	= start.o cpu_init.o lowlevel_init.o
> +COBJS	= nand_boot.o nand_ecc.o s3c64xx.o
> +
> +SRCS	:= $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
> +OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
> +__OBJS	:= $(SOBJS) $(COBJS)
> +LNDIR	:= $(OBJTREE)/nand_spl/board/$(BOARDDIR)
> +
> +nandobj	:= $(OBJTREE)/nand_spl/
> +
> +ALL	= $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
> +
> +all:	$(obj).depend $(ALL)
> +
> +$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
> +	$(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
> +
> +$(nandobj)u-boot-spl.bin:	$(nandobj)u-boot-spl
> +	$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
> +
> +$(nandobj)u-boot-spl:	$(OBJS)
> +	cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) \
> +		-Map $(nandobj)u-boot-spl.map \
> +		-o $(nandobj)u-boot-spl
please replace with
$(nandobj)u-boot-spl:	$(OBJS)
	cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) \
		-Map $@.map -o $@

Best Regards,
J.

      reply	other threads:[~2008-08-09  9:32 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-06 19:41 [U-Boot-Users] [PATCH 0/7 v6] SMDK6400 support Guennadi Liakhovetski
2008-08-06 19:42 ` [U-Boot-Users] [PATCH 2/7 v6] nand_spl: Support page-aligned read in nand_load, use chipselect Guennadi Liakhovetski
2008-08-06 22:54   ` Scott Wood
2008-08-07  6:36     ` Guennadi Liakhovetski
2008-08-06 19:42 ` [U-Boot-Users] [PATCH 3/7 v6] ARM: Add arm1176 core with S3C6400 SoC Guennadi Liakhovetski
2008-08-07  6:28   ` Andreas Engel
2008-08-07  6:55     ` Guennadi Liakhovetski
2008-08-07  9:33   ` Jens Gehrlein
2008-08-07  9:51     ` Wolfgang Denk
2008-08-07 10:03       ` Jens Gehrlein
2008-08-07 10:17         ` Wolfgang Denk
2008-08-07 11:03           ` Jens Gehrlein
2008-08-07 11:07             ` Jean-Christophe PLAGNIOL-VILLARD
2008-08-07 10:00   ` Jens Gehrlein
2008-08-07 10:12     ` Guennadi Liakhovetski
2008-08-07 11:12       ` Jens Gehrlein
2008-08-09  9:11   ` Jean-Christophe PLAGNIOL-VILLARD
2008-08-09  9:58     ` [U-Boot] " Wolfgang Denk
2008-08-09 10:07       ` Jean-Christophe PLAGNIOL-VILLARD
2008-08-11  8:17     ` [U-Boot-Users] " Guennadi Liakhovetski
2008-08-06 19:42 ` [U-Boot-Users] [PATCH 4/7 v6] USB: Add support for OHCI controller on S3C6400 Guennadi Liakhovetski
2008-08-07 15:56   ` Markus Klotzbücher
2008-08-07 15:53     ` Jean-Christophe PLAGNIOL-VILLARD
2008-08-08  9:16       ` Markus Klotzbücher
2008-08-06 19:42 ` [U-Boot-Users] [PATCH 5/7 v6] serial: add S3C64XX serial driver Guennadi Liakhovetski
2008-08-09  9:13   ` Jean-Christophe PLAGNIOL-VILLARD
2008-08-11  8:44     ` Guennadi Liakhovetski
2008-08-11 10:06       ` [U-Boot] " Wolfgang Denk
2008-08-11 10:53         ` Guennadi Liakhovetski
2008-08-11 12:12           ` Wolfgang Denk
2008-08-11 12:43             ` Guennadi Liakhovetski
2008-08-06 19:42 ` [U-Boot-Users] [PATCH 6/7 v6] NAND: add NAND driver for S3C64XX Guennadi Liakhovetski
2008-08-07 22:15   ` Scott Wood
2008-08-06 19:42 ` [U-Boot-Users] [PATCH 7/7 v6] ARM: Add support for S3C6400 based SMDK6400 board Guennadi Liakhovetski
2008-08-09  9:32   ` Jean-Christophe PLAGNIOL-VILLARD [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080809093210.GE18040@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox