Merge branch 'master' of git://git.denx.de/u-boot-marvell
authorWolfgang Denk <wd@denx.de>
Fri, 29 Oct 2010 20:03:00 +0000 (22:03 +0200)
committerWolfgang Denk <wd@denx.de>
Fri, 29 Oct 2010 20:03:00 +0000 (22:03 +0200)
Conflicts:
include/configs/km_arm.h

Signed-off-by: Wolfgang Denk <wd@denx.de>
18 files changed:
Makefile
arch/arm/cpu/arm926ejs/kirkwood/dram.c
board/Marvell/guruplug/config.mk [deleted file]
board/Marvell/guruplug/guruplug.c
board/Marvell/mv88f6281gtw_ge/config.mk [deleted file]
board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c
board/Marvell/openrd_base/config.mk [deleted file]
board/Marvell/openrd_base/openrd_base.c
board/Marvell/rd6281a/config.mk [deleted file]
board/Marvell/rd6281a/rd6281a.c
board/Marvell/sheevaplug/config.mk [deleted file]
board/Marvell/sheevaplug/sheevaplug.c
board/keymile/km_arm/config.mk [deleted file]
board/keymile/km_arm/km_arm.c
include/configs/guruplug.h
include/configs/keymile-common.h
include/configs/km_arm.h
include/configs/mv-common.h

index ae36ea5..f0c2703 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -357,7 +357,7 @@ $(obj)u-boot.imx:       $(obj)u-boot.bin
                -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
 
 $(obj)u-boot.kwb:       $(obj)u-boot.bin
-               $(obj)tools/mkimage -n $(KWD_CONFIG) -T kwbimage \
+               $(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \
                -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
 
 $(obj)u-boot.sha1:     $(obj)u-boot.bin
index 342afe9..2441554 100644 (file)
@@ -81,6 +81,16 @@ int dram_init(void)
                gd->ram_size += gd->bd->bi_dram[i].size;
 
        }
+
+       for (; i < CONFIG_NR_DRAM_BANKS; i++) {
+               /* If above loop terminated prematurely, we need to set
+                * remaining banks' start address & size as 0. Otherwise other
+                * u-boot functions and Linux kernel gets wrong values which
+                * could result in crash */
+               gd->bd->bi_dram[i].start = 0;
+               gd->bd->bi_dram[i].size = 0;
+       }
+
        return 0;
 }
 
diff --git a/board/Marvell/guruplug/config.mk b/board/Marvell/guruplug/config.mk
deleted file mode 100644 (file)
index 12d7737..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# (C) Copyright 2009
-# Marvell Semiconductor <www.marvell.com>
-# Written-by: Siddarth Gore <gores@marvell.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., 51 Franklin Street, Fifth Floor, Boston,
-# MA 02110-1301 USA
-#
-
-CONFIG_SYS_TEXT_BASE = 0x00600000
-
-KWD_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/kwbimage.cfg
index 4df4e9b..1f0e67a 100644 (file)
@@ -30,7 +30,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int board_init(void)
+int board_early_init_f(void)
 {
        /*
         * default gpio configuration
@@ -96,7 +96,11 @@ int board_init(void)
                0
        };
        kirkwood_mpp_conf(kwmpp_config);
+       return 0;
+}
 
+int board_init(void)
+{
        /*
         * arch number of board
         */
diff --git a/board/Marvell/mv88f6281gtw_ge/config.mk b/board/Marvell/mv88f6281gtw_ge/config.mk
deleted file mode 100644 (file)
index 761c2bb..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# (C) Copyright 2009
-# Marvell Semiconductor <www.marvell.com>
-# Written-by: Prafulla Wadaskar <prafulla@marvell.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., 51 Franklin Street, Fifth Floor, Boston,
-# MA 02110-1301 USA
-#
-
-CONFIG_SYS_TEXT_BASE = 0x00600000
-
-# Kirkwood Boot Image configuration file
-KWD_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/kwbimage.cfg
index 93d1400..80fd20b 100644 (file)
@@ -32,7 +32,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int board_init(void)
+int board_early_init_f(void)
 {
        /*
         * default gpio configuration
@@ -98,7 +98,11 @@ int board_init(void)
                0
        };
        kirkwood_mpp_conf(kwmpp_config);
+       return 0;
+}
 
+int board_init(void)
+{
        /*
         * arch number of board
         */
diff --git a/board/Marvell/openrd_base/config.mk b/board/Marvell/openrd_base/config.mk
deleted file mode 100644 (file)
index 5a49280..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# (C) Copyright 2009
-# Net Insight <www.netinsight.net>
-# Written-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
-#
-# Based on sheevaplug:
-# (C) Copyright 2009
-# Marvell Semiconductor <www.marvell.com>
-# Written-by: Prafulla Wadaskar <prafulla@marvell.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., 51 Franklin Street, Fifth Floor, Boston,
-# MA 02110-1301 USA
-#
-
-CONFIG_SYS_TEXT_BASE = 0x00600000
-
-# Kirkwood Boot Image configuration file
-KWD_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/kwbimage.cfg
index d006b2d..10109c1 100644 (file)
@@ -35,7 +35,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int board_init(void)
+int board_early_init_f(void)
 {
        /*
         * default gpio configuration
@@ -102,7 +102,11 @@ int board_init(void)
        };
 
        kirkwood_mpp_conf(kwmpp_config);
+       return 0;
+}
 
+int board_init(void)
+{
        /*
         * arch number of board
         */
diff --git a/board/Marvell/rd6281a/config.mk b/board/Marvell/rd6281a/config.mk
deleted file mode 100644 (file)
index 761c2bb..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# (C) Copyright 2009
-# Marvell Semiconductor <www.marvell.com>
-# Written-by: Prafulla Wadaskar <prafulla@marvell.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., 51 Franklin Street, Fifth Floor, Boston,
-# MA 02110-1301 USA
-#
-
-CONFIG_SYS_TEXT_BASE = 0x00600000
-
-# Kirkwood Boot Image configuration file
-KWD_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/kwbimage.cfg
index 0d76146..e69e035 100644 (file)
@@ -31,7 +31,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int board_init(void)
+int board_early_init_f(void)
 {
        /*
         * default gpio configuration
@@ -97,7 +97,11 @@ int board_init(void)
                0
        };
        kirkwood_mpp_conf(kwmpp_config);
+       return 0;
+}
 
+int board_init(void)
+{
        /*
         * arch number of board
         */
diff --git a/board/Marvell/sheevaplug/config.mk b/board/Marvell/sheevaplug/config.mk
deleted file mode 100644 (file)
index 761c2bb..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# (C) Copyright 2009
-# Marvell Semiconductor <www.marvell.com>
-# Written-by: Prafulla Wadaskar <prafulla@marvell.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., 51 Franklin Street, Fifth Floor, Boston,
-# MA 02110-1301 USA
-#
-
-CONFIG_SYS_TEXT_BASE = 0x00600000
-
-# Kirkwood Boot Image configuration file
-KWD_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/kwbimage.cfg
index 173a7b8..d7dc80c 100644 (file)
@@ -30,7 +30,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int board_init(void)
+int board_early_init_f(void)
 {
        /*
         * default gpio configuration
@@ -96,7 +96,11 @@ int board_init(void)
                0
        };
        kirkwood_mpp_conf(kwmpp_config);
+       return 0;
+}
 
+int board_init(void)
+{
        /*
         * arch number of board
         */
diff --git a/board/keymile/km_arm/config.mk b/board/keymile/km_arm/config.mk
deleted file mode 100644 (file)
index df4828c..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# (C) Copyright 2009
-# Marvell Semiconductor <www.marvell.com>
-# Prafulla Wadaskar <prafulla@marvell.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., 51 Franklin Street, Fifth Floor, Boston,
-# MA 02110-1301 USA
-#
-
-CONFIG_SYS_TEXT_BASE = 0x004000000
-
-# Kirkwood Boot Image configuration file
-KWD_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/kwbimage.cfg
index ed5ed44..2e20644 100644 (file)
@@ -143,7 +143,7 @@ int misc_init_r(void)
        return 0;
 }
 
-int board_init(void)
+int board_early_init_f(void)
 {
        u32 tmp;
 
@@ -160,14 +160,6 @@ int board_init(void)
        writel(tmp & (~FLASH_GPIO_PIN) , KW_GPIO0_BASE + 4);
        printf("KM: setting NAND mode\n");
 
-       /*
-        * arch number of board
-        */
-       gd->bd->bi_arch_number = MACH_TYPE_SUEN3;
-
-       /* address of boot parameters */
-       gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
-
 #if defined(CONFIG_SOFT_I2C)
        /* init the GPIO for I2C Bitbang driver */
        kw_gpio_set_valid(SUEN3_SDA_PIN, 1);
@@ -179,6 +171,20 @@ int board_init(void)
        kw_gpio_set_valid(SUEN3_ENV_WP, 38);
        kw_gpio_direction_output(SUEN3_ENV_WP, 1);
 #endif
+
+       return 0;
+}
+
+int board_init(void)
+{
+       /*
+        * arch number of board
+        */
+       gd->bd->bi_arch_number = MACH_TYPE_SUEN3;
+
+       /* address of boot parameters */
+       gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
+
        return 0;
 }
 
index 2c2682c..f449da9 100644 (file)
@@ -72,8 +72,8 @@
  * it has to be rounded to sector size
  */
 #define CONFIG_ENV_SIZE                        0x20000 /* 128k */
-#define CONFIG_ENV_ADDR                        0x40000
-#define CONFIG_ENV_OFFSET              0x40000 /* env starts here */
+#define CONFIG_ENV_ADDR                        0x60000
+#define CONFIG_ENV_OFFSET              0x60000 /* env starts here */
 
 /*
  * Default environment variables
index 62d21f6..ccc71c9 100644 (file)
 #define CONFIG_BOOTCOUNT_LIMIT
 
 /*
+ * By default kwbimage.cfg from board specific folder is used
+ * If for some board, different configuration file need to be used,
+ * CONFIG_SYS_KWD_CONFIG should be defined in board specific header file
+ */
+#ifndef CONFIG_SYS_KWD_CONFIG
+#define        CONFIG_SYS_KWD_CONFIG   $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage.cfg 
+#endif /* CONFIG_SYS_KWD_CONFIG */
+
+/* 
+ * CONFIG_SYS_TEXT_BASE can be defined in board specific header file, if needed
+ */
+#ifndef CONFIG_SYS_TEXT_BASE
+#define        CONFIG_SYS_TEXT_BASE    0x00400000
+#endif /* CONFIG_SYS_TEXT_BASE */
+
+/*
  * Command line configuration.
  */
 #include <config_cmd_default.h>
index 986c46e..bf77cc0 100644 (file)
@@ -181,6 +181,8 @@ int get_scl (void);
 
 /* additions for new relocation code, must be added to all boards */
 #define CONFIG_SYS_SDRAM_BASE          0x00000000
-#define CONFIG_SYS_INIT_SP_ADDR                (0x00000000 + 0x1000 - /* Fix this */ \
-                                       GENERATED_GBL_DATA_SIZE)
+/* Kirkwood has 2k of Security SRAM, use it for SP */
+#define CONFIG_SYS_INIT_SP_ADDR                0xC8012000
+/* Do early setups now in board_init_f() */
+#define CONFIG_BOARD_EARLY_INIT_F
 #endif /* _CONFIG_KM_ARM_H */
index bc81f2d..de0121e 100644 (file)
 #define CONFIG_KIRKWOOD_RGMII_PAD_1V8  /* Set RGMII Pad voltage to 1.8V */
 #define CONFIG_KIRKWOOD_PCIE_INIT       /* Enable PCIE Port0 for kernel */
 
+/* 
+ * By default kwbimage.cfg from board specific folder is used
+ * If for some board, different configuration file need to be used,
+ * CONFIG_SYS_KWD_CONFIG should be defined in board specific header file
+ */
+#ifndef CONFIG_SYS_KWD_CONFIG
+#define        CONFIG_SYS_KWD_CONFIG   $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage.cfg 
+#endif /* CONFIG_SYS_KWD_CONFIG */
+
+/* 
+ * CONFIG_SYS_TEXT_BASE can be defined in board specific header file, if needed
+ */
+#ifndef CONFIG_SYS_TEXT_BASE
+#define        CONFIG_SYS_TEXT_BASE    0x00600000
+#endif /* CONFIG_SYS_TEXT_BASE */
+
 #define CONFIG_I2C_MVTWSI_BASE KW_TWSI_BASE
 #define MV_UART0_BASE          KW_UART0_BASE
 #define MV_SATA_BASE           KW_SATA_BASE
 #define CONFIG_CONSOLE_INFO_QUIET      /* some code reduction */
 #define CONFIG_ARCH_CPU_INIT   /* call arch_cpu_init() */
 #define CONFIG_ARCH_MISC_INIT  /* call arch_misc_init() */
+#define CONFIG_BOARD_EARLY_INIT_F /* call board_init_f for early inits */ 
 #define CONFIG_DISPLAY_CPUINFO /* Display cpu info */
 #define CONFIG_NR_DRAM_BANKS   4
 #define CONFIG_STACKSIZE       0x00100000      /* regular stack- 1M */