From 6b0ccc3b456bcec534620aac93427e4a2207a66a Mon Sep 17 00:00:00 2001 From: Heiko Schocher <[hs@denx.de]> Date: Wed, 20 Oct 2010 19:33:26 +0530 Subject: arm926ejs, suen3: fix relocation issues - use internal 2k security SRAM as RAM for early stack. - do early inits in board_init_f() Signed-off-by: Heiko Schocher Cc: Prafulla Wadaskar diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c index 7c0b858..a2a8bfe 100644 --- a/board/keymile/km_arm/km_arm.c +++ b/board/keymile/km_arm/km_arm.c @@ -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; } diff --git a/include/configs/km_arm.h b/include/configs/km_arm.h index faa0f50..4b706f1 100644 --- a/include/configs/km_arm.h +++ b/include/configs/km_arm.h @@ -182,6 +182,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 */ \ - CONFIG_SYS_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 */ -- cgit v0.10.2 From 754ae3fbb76dc429ef932bbd04b432196efe45ff Mon Sep 17 00:00:00 2001 From: Prafulla Wadaskar Date: Wed, 20 Oct 2010 20:12:27 +0530 Subject: Kirkwood: bugfix: broken early console messages It has been observed that, the complete u-boot banner does not appear on the console when the system is booted from NAND/NOR/SPI flash. This patch fixes this issue on all Marvell boards by adding board_early_init_f() support Signed-off-by: Prafulla Wadaskar diff --git a/board/Marvell/guruplug/guruplug.c b/board/Marvell/guruplug/guruplug.c index 4df4e9b..1f0e67a 100644 --- a/board/Marvell/guruplug/guruplug.c +++ b/board/Marvell/guruplug/guruplug.c @@ -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/mv88f6281gtw_ge.c b/board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c index 93d1400..80fd20b 100644 --- a/board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c +++ b/board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c @@ -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/openrd_base.c b/board/Marvell/openrd_base/openrd_base.c index d006b2d..10109c1 100644 --- a/board/Marvell/openrd_base/openrd_base.c +++ b/board/Marvell/openrd_base/openrd_base.c @@ -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/rd6281a.c b/board/Marvell/rd6281a/rd6281a.c index 0d76146..e69e035 100644 --- a/board/Marvell/rd6281a/rd6281a.c +++ b/board/Marvell/rd6281a/rd6281a.c @@ -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/sheevaplug.c b/board/Marvell/sheevaplug/sheevaplug.c index 173a7b8..d7dc80c 100644 --- a/board/Marvell/sheevaplug/sheevaplug.c +++ b/board/Marvell/sheevaplug/sheevaplug.c @@ -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/include/configs/mv-common.h b/include/configs/mv-common.h index bdcebd3..2b19a34 100644 --- a/include/configs/mv-common.h +++ b/include/configs/mv-common.h @@ -142,6 +142,7 @@ #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 */ -- cgit v0.10.2 From 5842383e25910636d2e9a722f0ef1a2ec7951b36 Mon Sep 17 00:00:00 2001 From: Gray Remlin <[g_remlin@rocketmail.com]> Date: Thu, 28 Oct 2010 19:02:12 +0530 Subject: kirkwood: guruplug: Relocate NAND environment area Current default options increase u-boot size to overlap the location of the environment in NAND, move environment higher up Signed-off-by: Gray Remlin diff --git a/include/configs/guruplug.h b/include/configs/guruplug.h index 2c2682c..f449da9 100644 --- a/include/configs/guruplug.h +++ b/include/configs/guruplug.h @@ -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 -- cgit v0.10.2 From 31d80c77ff672e0202b4ada5215c4666c949ffc2 Mon Sep 17 00:00:00 2001 From: Prafulla Wadaskar Date: Wed, 27 Oct 2010 17:46:06 +0530 Subject: kirkwood: get rid of config.mk files After moving the definition of CONFIG_SYS_TEXT_BASE to the respective board config files, all Marvell kirkwood board have just a single and common entry in their config.mk files: KWD_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/kwbimage.cfg Replace the only reference to KWD_CONFIG in the top level Makefile by an equivalent setting, and remove all kirkwood config.mk files. Signed-off-by: Wolfgang Denk Cc: Prafulla Wadaskar Cc: Siddarth Gore Cc: Simon Kagstrom Cc: Heiko Schocher Cc: Eric Cooper Acked-by: Wolfgang Denk Signed-off-by: Prafulla Wadaskar diff --git a/Makefile b/Makefile index 06c71a2..62377c1 100644 --- 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 diff --git a/board/Marvell/guruplug/config.mk b/board/Marvell/guruplug/config.mk deleted file mode 100644 index 12d7737..0000000 --- a/board/Marvell/guruplug/config.mk +++ /dev/null @@ -1,27 +0,0 @@ -# -# (C) Copyright 2009 -# Marvell Semiconductor -# Written-by: Siddarth Gore -# -# 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 diff --git a/board/Marvell/mv88f6281gtw_ge/config.mk b/board/Marvell/mv88f6281gtw_ge/config.mk deleted file mode 100644 index 761c2bb..0000000 --- a/board/Marvell/mv88f6281gtw_ge/config.mk +++ /dev/null @@ -1,28 +0,0 @@ -# -# (C) Copyright 2009 -# Marvell Semiconductor -# Written-by: Prafulla Wadaskar -# -# 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 diff --git a/board/Marvell/openrd_base/config.mk b/board/Marvell/openrd_base/config.mk deleted file mode 100644 index 5a49280..0000000 --- a/board/Marvell/openrd_base/config.mk +++ /dev/null @@ -1,33 +0,0 @@ -# -# (C) Copyright 2009 -# Net Insight -# Written-by: Simon Kagstrom -# -# Based on sheevaplug: -# (C) Copyright 2009 -# Marvell Semiconductor -# Written-by: Prafulla Wadaskar -# -# 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 diff --git a/board/Marvell/rd6281a/config.mk b/board/Marvell/rd6281a/config.mk deleted file mode 100644 index 761c2bb..0000000 --- a/board/Marvell/rd6281a/config.mk +++ /dev/null @@ -1,28 +0,0 @@ -# -# (C) Copyright 2009 -# Marvell Semiconductor -# Written-by: Prafulla Wadaskar -# -# 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 diff --git a/board/Marvell/sheevaplug/config.mk b/board/Marvell/sheevaplug/config.mk deleted file mode 100644 index 761c2bb..0000000 --- a/board/Marvell/sheevaplug/config.mk +++ /dev/null @@ -1,28 +0,0 @@ -# -# (C) Copyright 2009 -# Marvell Semiconductor -# Written-by: Prafulla Wadaskar -# -# 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 diff --git a/board/keymile/km_arm/config.mk b/board/keymile/km_arm/config.mk deleted file mode 100644 index df4828c..0000000 --- a/board/keymile/km_arm/config.mk +++ /dev/null @@ -1,28 +0,0 @@ -# -# (C) Copyright 2009 -# Marvell Semiconductor -# Prafulla Wadaskar -# -# 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 diff --git a/include/configs/keymile-common.h b/include/configs/keymile-common.h index 62d21f6..ccc71c9 100644 --- a/include/configs/keymile-common.h +++ b/include/configs/keymile-common.h @@ -30,6 +30,22 @@ #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 diff --git a/include/configs/mv-common.h b/include/configs/mv-common.h index 2b19a34..e4a8148 100644 --- a/include/configs/mv-common.h +++ b/include/configs/mv-common.h @@ -45,6 +45,22 @@ #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 -- cgit v0.10.2 From 28e57108a61bd0e554d9847170b8ad9dad093e07 Mon Sep 17 00:00:00 2001 From: Tanmay Upadhyay <[tanmay.upadhyay@einfochips.com]> Date: Thu, 28 Oct 2010 20:06:22 +0530 Subject: Kirkwood: bugfix: DRAM size initialization If start of any DRAM bank is greater than total DDR size, remaining DDR banks' start address & size were left un-initialized in dram_init function. This could break other functions who uses array 'gd->bd->bi_dram'. Kirkwood network driver is one example. This also stops Linux kernel from booting. v2 - Set start address also to 0. Without this Linux kernel couldn't boot up Signed-off-by: Tanmay Upadhyay diff --git a/arch/arm/cpu/arm926ejs/kirkwood/dram.c b/arch/arm/cpu/arm926ejs/kirkwood/dram.c index 7439c87..a4344b8 100644 --- a/arch/arm/cpu/arm926ejs/kirkwood/dram.c +++ b/arch/arm/cpu/arm926ejs/kirkwood/dram.c @@ -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; } -- cgit v0.10.2