[U-Boot] [RFC PATCH] ARM: S3C64XX: add support for mini6410

Minkyu Kang promsoft at gmail.com
Tue Nov 30 01:49:06 CET 2010


Dear Darius Augulis,

On 18 November 2010 06:26, Darius Augulis <augulis.darius at gmail.com> wrote:
> Add support for mini6410 from FriendlyARM
>
> Signed-off-by: Darius Augulis <augulis.darius at gmail.com>
> ---
>  MAKEALL                                         |    1
>  Makefile                                        |    4
>  arch/arm/cpu/arm1176/s3c64xx/Makefile           |    6 -
>  board/friendly_arm/mini6410/Makefile            |   59 +++++
>  board/friendly_arm/mini6410/config.mk           |    5
>  board/friendly_arm/mini6410/lowlevel_init.S     |  256 +++++++++++++++++++++++
>  board/friendly_arm/mini6410/mini6410.c          |   99 +++++++++
>  boards.cfg                                      |    1
>  include/configs/mini6410.h                      |  137 ++++++++++++
>  nand_spl/board/friendly_arm/mini6410/Makefile   |  107 ++++++++++
>  nand_spl/board/friendly_arm/mini6410/config.mk  |    7 +
>  nand_spl/board/friendly_arm/mini6410/u-boot.lds |   85 ++++++++
>  nand_spl/nand_boot_s3c.c                        |  131 ++++++++++++
>  13 files changed, 896 insertions(+), 2 deletions(-)
>  create mode 100644 board/friendly_arm/mini6410/Makefile
>  create mode 100644 board/friendly_arm/mini6410/config.mk
>  create mode 100644 board/friendly_arm/mini6410/lowlevel_init.S
>  create mode 100644 board/friendly_arm/mini6410/mini6410.c
>  create mode 100644 include/configs/mini6410.h
>  create mode 100644 nand_spl/board/friendly_arm/mini6410/Makefile
>  create mode 100644 nand_spl/board/friendly_arm/mini6410/config.mk
>  create mode 100644 nand_spl/board/friendly_arm/mini6410/u-boot.lds
>  create mode 100644 nand_spl/nand_boot_s3c.c

missing Maintainer entry

Please clean your patch by checkpatch.
Your patch have 23 errors, 22 warnings.

>
> diff --git a/MAKEALL b/MAKEALL
> index 767d561..556aa82 100755
> --- a/MAKEALL
> +++ b/MAKEALL
> @@ -404,6 +404,7 @@ LIST_ARM11="                        \
>        imx31_litekit           \
>        imx31_phycore           \
>        imx31_phycore_eet       \
> +       mini6410                \
>        mx31ads                 \
>        mx31pdk                 \
>        mx31pdk_nand            \
> diff --git a/Makefile b/Makefile
> index f0c2703..4dab98d 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1087,6 +1087,10 @@ smdk6400_config  :       unconfig
>        @$(MKCONFIG) smdk6400 arm arm1176 smdk6400 samsung s3c64xx
>        @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
>
> +mini6410_config :      unconfig
> +       @mkdir -p $(obj)include
> +       @$(MKCONFIG) mini6410 arm arm1176 mini6410 friendly_arm s3c64xx
> +

unnecessary, because of board.cfg

>  #========================================================================
>  # MIPS
>  #========================================================================
> diff --git a/arch/arm/cpu/arm1176/s3c64xx/Makefile b/arch/arm/cpu/arm1176/s3c64xx/Makefile
> index b527939..6ce2b06 100644
> --- a/arch/arm/cpu/arm1176/s3c64xx/Makefile
> +++ b/arch/arm/cpu/arm1176/s3c64xx/Makefile
> @@ -1,4 +1,7 @@
>  #
> +# (C) Copyright 2010
> +# Darius Augulis, <augulis.darius at gmail.com>
> +#
>  # (C) Copyright 2000-2003
>  # Wolfgang Denk, DENX Software Engineering, wd at denx.de.
>  #
> @@ -30,8 +33,7 @@ LIB   = $(obj)lib$(SOC).a
>
>  SOBJS  = reset.o
>
> -COBJS-$(CONFIG_S3C6400)        += cpu_init.o speed.o
> -COBJS-y        += timer.o
> +COBJS-y        += timer.o cpu_init.o speed.o
>
>  OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS-y))
>
> diff --git a/board/friendly_arm/mini6410/Makefile b/board/friendly_arm/mini6410/Makefile
> new file mode 100644
> index 0000000..a1dbc41
> --- /dev/null
> +++ b/board/friendly_arm/mini6410/Makefile
> @@ -0,0 +1,59 @@
> +#
> +# (C) Copyright 2010
> +# Darius Augulis, <augulis.darius at gmail.com>
> +#
> +# (C) Copyright 2000, 2001, 2002
> +# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
> +#
> +# (C) Copyright 2008
> +# Guennadi Liakhovetki, DENX Software Engineering, <lg 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., 675 Mass Ave, Cambridge, MA 02139, USA.
> +#
> +
> +include $(TOPDIR)/config.mk
> +
> +LIB    = $(obj)lib$(BOARD).a
> +
> +COBJS          += mini6410.o
> +SOBJS  := lowlevel_init.o
> +
> +SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
> +OBJS   := $(addprefix $(obj),$(COBJS))
> +SOBJS  := $(addprefix $(obj),$(SOBJS))
> +
> +.PHONY: all
> +
> +all: $(LIB)
> +
> +$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
> +       $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
> +
> +clean:
> +       rm -f $(SOBJS) $(OBJS)
> +
> +distclean:     clean
> +       rm -f $(LIB) core *.bak *~ .depend
> +
> +#########################################################################
> +# This is for $(obj).depend target
> +include $(SRCTREE)/rules.mk
> +
> +sinclude $(obj).depend
> +
> +#########################################################################
> diff --git a/board/friendly_arm/mini6410/mini6410.c b/board/friendly_arm/mini6410/mini6410.c
> new file mode 100644
> index 0000000..b96a23c
> --- /dev/null
> +++ b/board/friendly_arm/mini6410/mini6410.c
> @@ -0,0 +1,99 @@
> +/*
> + * (C) Copyright 2010
> + * Darius Augulis, <augulis.darius at gmail.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 <netdev.h>
> +#include <asm/arch/s3c6400.h>
> +
> +/* ------------------------------------------------------------------------- */
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +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
> + */
> +
> +#define DM9000_Tacs     (0x0)   // 0clk         address set-up
> +#define DM9000_Tcos     (0x4)   // 4clk         chip selection set-up
> +#define DM9000_Tacc     (0xE)   // 14clk        access cycle
> +#define DM9000_Tcoh     (0x1)   // 1clk         chip selection hold
> +#define DM9000_Tah      (0x4)   // 4clk         address holding time
> +#define DM9000_Tacp     (0x6)   // 6clk         page mode access cycle
> +#define DM9000_PMC      (0x0)   // normal(1data)page mode configuration

Please fix comments and please don't use lowercase at defines

> +
> +static void dm9000_pre_init(void)
> +{
> +       SROM_BW_REG &= ~(0xf << 4);

u-boot don't allow it.
Please use read/write function.
And please access the register by C structure.

> +       SROM_BW_REG |= (1 << 7) | (1 << 6) | (1 << 4);
> +       SROM_BC1_REG = ((DM9000_Tacs << 28) + (DM9000_Tcos << 24 ) +
> +                       (DM9000_Tacc << 16) + (DM9000_Tcoh << 12) +
> +                       (DM9000_Tah << 8) + (DM9000_Tacp << 4) + (DM9000_PMC));
> +

please remove this dead space

> +}
> +
> +int board_init(void)
> +{
> +       dm9000_pre_init();
> +
> +       gd->bd->bi_arch_number = MACH_TYPE;

Please use MACH_TYPE_MINI6410 (arch/arm/include/asm/mach-types.h)

> +       gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
> +
> +       return 0;
> +}
> +
> +int dram_init (void)
> +{
> +        /* dram_init must store complete ramsize in gd->ram_size */
> +        gd->ram_size = get_ram_size((volatile void *)PHYS_SDRAM_1,
> +                                PHYS_SDRAM_1_SIZE);
> +        return 0;
> +}
> +
> +void dram_init_banksize(void)
> +{
> +        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
> +        gd->bd->bi_dram[0].size = get_ram_size((volatile void *)PHYS_SDRAM_1,
> +                        PHYS_SDRAM_1_SIZE);
> +}
> +
> +#ifdef CONFIG_DISPLAY_BOARDINFO
> +int checkboard(void)
> +{
> +       printf("Board:   MINI6410\n");
> +       return 0;
> +}
> +#endif
> +
> +#ifdef CONFIG_CMD_NET
> +int board_eth_init(bd_t *bis)
> +{
> +       return dm9000_initialize(bis);
> +}
> +#endif
> diff --git a/boards.cfg b/boards.cfg
> index 08e531e..54b3015 100644
> --- a/boards.cfg
> +++ b/boards.cfg
> @@ -354,6 +354,7 @@ PM826_ROMBOOT_BIGFLASH        powerpc  mpc8260  pm826       -               -       PM826:BOOT_ROM,FLASH_32MB,
>  imx31_litekit  arm     arm1136         -               logicpd         mx31
>  omap2420h4     arm     arm1136         -               ti              omap24xx
>  tnetv107x_evm  arm     arm1176         tnetv107xevm    ti              tnetv107x
> +mini6410       arm     arm1176         mini6410        friendly_arm    s3c64xx
>  armadillo      arm     arm720t
>  modnet50       arm     arm720t
>  lpc2292sodimm  arm     arm720t         -               -               lpc2292
> diff --git a/include/configs/mini6410.h b/include/configs/mini6410.h
> new file mode 100644
> index 0000000..e2dcbd4
> --- /dev/null
> +++ b/include/configs/mini6410.h
> @@ -0,0 +1,137 @@
> +/*
> + * (C) Copyright 2010
> + * Darius Augulis <augulis.darius at gmail.com>
> + *
> + * (C) Copyright 2008
> + * Guennadi Liakhovetki, DENX Software Engineering, <lg 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., 675 Mass Ave, Cambridge, MA 02139, USA.
> + */
> +
> +#ifndef __CONFIG_H
> +#define __CONFIG_H
> +
> +/* High Level Configuration Options */
> +#define CONFIG_S3C6410                 1
> +#define CONFIG_S3C64XX                 1
> +#define CONFIG_MINI6410                        1
> +
> +#define CONFIG_SYS_NO_FLASH            1
> +#define CONFIG_NAND_U_BOOT             1
> +
> +#define CONFIG_PERIPORT_REMAP
> +#define CONFIG_PERIPORT_BASE           0x70000000
> +#define CONFIG_PERIPORT_SIZE           0x13
> +
> +/* Relocation and internal SRAM options */
> +#define CONFIG_SYS_IRAM_BASE           0x0C000000      /* Internal SRAM base address */
> +#define CONFIG_SYS_IRAM_SIZE           0x2000          /* 8 KB of internal SRAM memory */
> +#define CONFIG_SYS_IRAM_END            (CONFIG_SYS_IRAM_BASE + CONFIG_SYS_IRAM_SIZE)
> +#define CONFIG_SYS_INIT_SP_ADDR                (CONFIG_SYS_IRAM_END - GENERATED_GBL_DATA_SIZE)
> +
> +/* SDRAM options */
> +#define CONFIG_SYS_SDRAM_BASE          0x50000000
> +#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE   /* memtest works on */
> +#define CONFIG_SYS_MEMTEST_END         CONFIG_SYS_TEXT_BASE    /* 126MiB in DRAM */
> +#define CONFIG_SYS_LOAD_ADDR           CONFIG_SYS_SDRAM_BASE   /* default load address */
> +
> +#define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + 1024 * 1024)
> +#define CONFIG_SYS_UBOOT_BASE          CONFIG_SYS_TEXT_BASE
> +#define CONFIG_SYS_UBOOT_SIZE          (1024 * 1024)
> +
> +#define CONFIG_NR_DRAM_BANKS           1
> +#define PHYS_SDRAM_1                   CONFIG_SYS_SDRAM_BASE
> +#define PHYS_SDRAM_1_SIZE              0x08000000              /* 128 MB */
> +
> +/* Environment options */
> +#define CONFIG_ENV_OVERWRITE
> +#define CONFIG_ENV_SIZE                        0x20000
> +#define CONFIG_ENV_OFFSET              0x40000
> +#define CONFIG_ENV_IS_IN_NAND
> +
> +/* Miscellaneous configurable options */
> +#define CONFIG_SYS_LONGHELP
> +#define CONFIG_SYS_PROMPT              "MINI6410 # "
> +#define CONFIG_SYS_CBSIZE              256
> +#define CONFIG_SYS_PBSIZE              384
> +#define CONFIG_SYS_MAXARGS             16
> +#define CONFIG_SYS_BARGSIZE            CONFIG_SYS_CBSIZE
> +#define CONFIG_IDENT_STRING            " for MINI6410"
> +
> +#define CONFIG_SYS_HZ                  1000
> +#define CONFIG_SYS_CLK_FREQ            12000000
> +#define MACH_TYPE                      2520

please remove this MACH_TYPE.

> +#define CONFIG_BOOTDELAY               5
> +#define CONFIG_SETUP_MEMORY_TAGS
> +#define CONFIG_CMDLINE_TAG
> +#define CONFIG_DISPLAY_CPUINFO
> +#define CONFIG_DISPLAY_BOARDINFO
> +#define CONFIG_ZERO_BOOTDELAY_CHECK
> +
> +#define CONFIG_CLK_533_133_66
> +#define CONFIG_SYNC_MODE
> +
> +/* Network */
> +#define CONFIG_NET_MULTI               1
> +#define CONFIG_DRIVER_DM9000           1
> +#define CONFIG_DM9000_NO_SROM          1
> +#define CONFIG_DM9000_BASE             0x18000000
> +#define DM9000_IO                      CONFIG_DM9000_BASE
> +#define DM9000_DATA                    (CONFIG_DM9000_BASE+4)
> +#define CONFIG_ETHADDR                 00:01:02:03:04:05
> +#define CONFIG_IPADDR                  192.168.1.20
> +#define CONFIG_SERVERIP                        192.168.1.1
> +#define CONFIG_GATEWAYIP               192.168.1.1
> +#define CONFIG_NETMASK                 255.255.255.0
> +
> +/* serial console configuration */
> +#define CONFIG_SERIAL1                 1
> +#define CONFIG_SYS_HUSH_PARSER
> +#define CONFIG_SYS_PROMPT_HUSH_PS2     "> "
> +
> +#define CONFIG_CMDLINE_EDITING
> +#define CONFIG_BAUDRATE                        115200
> +#define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200 }
> +#define CONFIG_BOOTCOMMAND             "nand read 50100000 100000 300000; bootm 50100000"

If you load the uImage to 0x500fffc0 (0x50100000 - 0x40), then you can
reduce the boot time (about 0.5 sec?).

> +#define CONFIG_BOOTARGS                        "root=/dev/mtdblock1 rw console=ttySAC0 mini6410=0"
> +
> +/* Command definition */
> +#include <config_cmd_default.h>
> +#define CONFIG_CMD_CACHE
> +#define CONFIG_CMD_PING
> +#define CONFIG_CMD_NAND
> +#define CONFIG_CMD_SAVEENV

CONFIG_CMD_SAVEENV is in config_cmd_default.

> +
> +/* NAND configuration */
> +#define CONFIG_SYS_MAX_NAND_DEVICE     1
> +#define CONFIG_SYS_NAND_BASE           0x70200010
> +#define CONFIG_BOOT_NAND
> +#define CONFIG_NAND
> +#define CONFIG_NAND_S3C64XX
> +
> +#define CONFIG_SYS_NAND_PAGE_SIZE      (2 * 1024)
> +#define CONFIG_SYS_NAND_PAGE_COUNT     64
> +#define CONFIG_SYS_NAND_BLOCK_SIZE     (CONFIG_SYS_NAND_PAGE_SIZE * CONFIG_SYS_NAND_PAGE_COUNT)
> +
> +#define CONFIG_SYS_NAND_U_BOOT_DST     0x57E00000
> +#define CONFIG_SYS_NAND_U_BOOT_START   CONFIG_SYS_NAND_U_BOOT_DST
> +
> +#define CONFIG_SYS_NAND_U_BOOT_OFFS    (4 * 1024)
> +#define CONFIG_SYS_NAND_U_BOOT_SIZE    (252 * 1024)
> +
> +#endif /* __CONFIG_H */

Thanks.
Minkyu Kang
-- 
from. prom.
www.promsoft.net


More information about the U-Boot mailing list